Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rsporny committed Oct 22, 2024
1 parent a6769d1 commit 8f54dd0
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .github/actions/tests/setup-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ description: 'Setup ptyhon for running e2e tests'
runs:
using: composite
steps:
- name: configure kubectl
uses: ./.github/actions/tests/configure-kubectl
env:
kubeconfig_base64: ${{ env.kubeconfig_base64 }}
K8S_SERVER: ${{ env.K8S_SERVER }}
K8S_SA_TOKEN: ${{ env.K8S_SA_TOKEN }}
- name: checkout pc-tests ref_name branch
id: pc-tests
uses: actions/checkout@v4
Expand Down
87 changes: 69 additions & 18 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure kubectl
uses: ./.github/actions/tests/staging-preview-tests
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 }}
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
- name: Run smoke tests
uses: ./.github/actions/tests/run-e2e-tests
with:
Expand All @@ -236,16 +233,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure kubectl
uses: ./.github/actions/tests/staging-preview-tests
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 }}
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
- name: Run all tests (some skipped due to new deployment)
uses: ./.github/actions/tests/run-e2e-tests
env:
Expand All @@ -257,7 +251,7 @@ jobs:
markers: "not active_flow and not passive_flow"
deployment_mc_epoch: $DEPLOYMENT_MC_EPOCH

wait-for-next-epoch:
wait-for-n1-epoch:
permissions:
id-token: write
contents: read
Expand All @@ -267,7 +261,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Configure kubectl
uses: ./.github/actions/tests/staging-preview-tests
uses: ./.github/actions/tests/configure-kubectl
env:
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
Expand All @@ -289,26 +283,83 @@ jobs:
node: staging-preview-validator-1
environment: staging-preview

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

wait-for-n2-epoch:
permissions:
id-token: write
contents: read
needs: wait-for-n1-epoch
runs-on: [self-hosted, eks]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure kubectl
uses: ./.github/actions/tests/staging-preview-tests
uses: ./.github/actions/tests/configure-kubectl
env:
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
- name: Set MC epoch to wait for
id: increment-epoch
env:
DEPLOYMENT_MC_EPOCH: ${{needs.partner-chain-ready.outputs.deployment_mc_epoch}}
run: |
echo "Current epoch: $DEPLOYMENT_MC_EPOCH"
incremented_epoch=$((DEPLOYMENT_MC_EPOCH + 2))
echo "Incremented epoch: $incremented_epoch"
echo "mc_epoch_to_wait_for=$incremented_epoch" >> $GITHUB_OUTPUT
- name: Wait for next MC epoch
uses: ./.github/actions/tests/wait-for-epoch
with:
epoch: ${{ steps.increment-epoch.outputs.mc_epoch_to_wait_for }}
deployment: kubernetes
node: staging-preview-validator-1
environment: staging-preview

run-all-tests-on-n2-epoch:
permissions:
id-token: write
contents: read
needs: wait-for-n2-epoch
runs-on: [self-hosted, eks]
steps:
- name: Checkout
uses: actions/checkout@v4
- 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)
kubeconfig_base64: ${{ secrets.kubeconfig_base64 }}
K8S_SERVER: ${{ secrets.K8S_SERVER }}
K8S_SA_TOKEN: ${{ secrets.K8S_SA_TOKEN }}
- name: Run all tests (no skipped tests)
uses: ./.github/actions/tests/run-e2e-tests
env:
DEPLOYMENT_MC_EPOCH: ${{needs.partner-chain-ready.outputs.deployment_mc_epoch}}
Expand Down

0 comments on commit 8f54dd0

Please sign in to comment.