Skip to content

Commit

Permalink
add: wait for next epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
rsporny committed Oct 22, 2024
1 parent 222643d commit 2affc44
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/actions/tests/run-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
mc_epoch:
description: 'MC epoch to test (committee tests)'
required: false
latest_mc_epoch:
description: 'Parametrize committee tests to verify whole last MC epoch'
required: false
deployment_mc_epoch:
description: 'Deployment MC epoch'
required: false
Expand All @@ -33,7 +36,6 @@ inputs:
decrypt:
description: 'Decrypt secrets'
required: false
default: 'false'

runs:
using: composite
Expand All @@ -44,6 +46,9 @@ runs:
if [ -n "${{ inputs.mc_epoch }}" ]; then
mc_epoch_switch="--mc-epoch ${{ inputs.mc_epoch }}"
fi
if [ "${{ inputs.latest_mc_epoch }}" = "true" ]; then
latest_mc_epoch_switch="--latest-mc-epoch"
fi
if [ -n "${{ inputs.deployment_mc_epoch }}" ]; then
deployment_mc_epoch_switch="--deployment-mc-epoch ${{ inputs.deployment_mc_epoch }}"
fi
Expand All @@ -61,6 +66,7 @@ runs:
-m "${{ inputs.markers }}" \
--init-timestamp ${{ inputs.init_timestamp }} \
$mc_epoch_switch \
$latest_mc_epoch_switch \
$decrypt_switch \
--json-report \
--json-report-summary \
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/tests/wait-for-epoch/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ runs:
elif [ "${{ inputs.deployment }}" == "kubernetes" ]; then
if [ "${{ inputs.environment }}" == "staging-preview" ]; then
testnet_magic=1
elif [ "${{ inputs.environment }}" == "staging-preprod" ]; then
testnet_magic=2
elif [ "${{ inputs.environment }}" == "staging-preprod" ]; then
testnet_magic=1
else
echo "Invalid environment for Kubernetes deployment"
exit 1
Expand Down
57 changes: 56 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,62 @@ jobs:
decrypt: true
markers: "not active_flow and not passive_flow"
deployment_mc_epoch: ${{ env.DEPLOYMENT_MC_EPOCH }}


wait-for-next-epoch:
permissions:
id-token: write
contents: read
needs: partner-chain-ready
runs-on: [self-hosted, eks]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set MC epoch to wait for
id: increment-epoch
run: |
echo "Current epoch: $DEPLOYMENT_MC_EPOCH"
incremented_epoch=$((DEPLOYMENT_MC_EPOCH + 1))
echo "Incremented epoch: $incremented_epoch"
echo "::set-output name=epoch::$incremented_epoch"
- name: Wait for next MC epoch
uses: ./.github/actions/tests/wait-for-epoch
with:
epoch: ${{ steps.increment-epoch.outputs.epoch }}"
deployment: kubernetes
node: staging-preview-validator-1
environment: staging-preview

run-all-tests-2:
permissions:
id-token: write
contents: read
needs: wait-for-next-epoch
runs-on: [self-hosted, eks]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure kubectl
uses: ./.github/actions/tests/staging-preview-tests
with:
node-host: $STAGING_PREVIEW_VALIDATOR_1_HOST
node-port: $STAGING_PREVIEW_VALIDATOR_1_PORT
env:
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
- name: Setup tests
uses: ./.github/actions/tests/setup-python
env:
ACTIONS_PAT: ${{ secrets.ACTIONS_PAT }}
- name: Run all tests (some skipped due to new deployment)
uses: ./.github/actions/tests/run-e2e-tests
with:
blockchain: substrate
env: staging
decrypt: true
latest_mc_epoch: true
markers: "not active_flow and not passive_flow"
deployment_mc_epoch: ${{ env.DEPLOYMENT_MC_EPOCH }}

# build-and-publish-ghcr:
# permissions:
Expand Down

0 comments on commit 2affc44

Please sign in to comment.