Skip to content

Commit

Permalink
feat: node upgrade command and new e2e tests (#1133)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
Signed-off-by: JeffreyDallas <[email protected]>
Co-authored-by: Jeromy Cannon <[email protected]>
  • Loading branch information
JeffreyDallas and jeromy-cannon authored Jan 13, 2025
1 parent 3640e9a commit 1cf5893
Show file tree
Hide file tree
Showing 18 changed files with 581 additions and 55 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/autogen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ The Solo autogen tool is used to add e2e test cases that need to be ran independ

## Usage

from solo root directory:
After a new e2e test is created, please add it to the configuration file first:

```bash
.github/workflows/templates/config.yaml
```

Next, from solo root directory:

```bash
cd .github/workflows/autogen
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/flow-build-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
- { name: "Node Delete", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}" }
- { name: "Node Delete - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}" }
- { name: "Node Upgrade", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-coverage-report }}" }
- { name: "Node Upgrade - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}" }
- { name: "Relay", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-relay-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-relay-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-relay-coverage-report }}" }
max-parallel: 3
with:
Expand Down Expand Up @@ -123,9 +124,11 @@ jobs:
e2e-node-add-local-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}
e2e-node-add-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}
e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
e2e-node-update-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-separate-commands-test-subdir }}
e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
e2e-node-delete-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}
e2e-node-upgrade-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}
e2e-node-upgrade-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
e2e-integration-coverage-report: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }}
e2e-standard-coverage-report: ${{ needs.env-vars.outputs.e2e-standard-coverage-report }}
Expand All @@ -138,9 +141,11 @@ jobs:
e2e-node-add-local-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-local-coverage-report }}
e2e-node-add-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}
e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
e2e-node-update-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-separate-commands-coverage-report }}
e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
e2e-node-delete-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}
e2e-node-upgrade-coverage-report: ${{ needs.env-vars.outputs.e2e-node-upgrade-coverage-report }}
e2e-node-upgrade-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
secrets:
snyk-token: ${{ secrets.SNYK_TOKEN }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/flow-pull-request-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
- { name: "Node Delete", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}" }
- { name: "Node Delete - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}" }
- { name: "Node Upgrade", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-coverage-report }}" }
- { name: "Node Upgrade - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}" }
- { name: "Relay", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-relay-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-relay-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-relay-coverage-report }}" }
max-parallel: 3
with:
Expand Down Expand Up @@ -120,9 +121,11 @@ jobs:
e2e-node-add-local-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}
e2e-node-add-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}
e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
e2e-node-update-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-separate-commands-test-subdir }}
e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
e2e-node-delete-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}
e2e-node-upgrade-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}
e2e-node-upgrade-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
e2e-integration-coverage-report: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }}
e2e-standard-coverage-report: ${{ needs.env-vars.outputs.e2e-standard-coverage-report }}
Expand All @@ -135,9 +138,11 @@ jobs:
e2e-node-add-local-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-local-coverage-report }}
e2e-node-add-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}
e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
e2e-node-update-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-separate-commands-coverage-report }}
e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
e2e-node-delete-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}
e2e-node-upgrade-coverage-report: ${{ needs.env-vars.outputs.e2e-node-upgrade-coverage-report }}
e2e-node-upgrade-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
secrets:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -165,9 +170,11 @@ jobs:
e2e-node-add-local-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}
e2e-node-add-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}
e2e-node-update-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}
e2e-node-update-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-update-separate-commands-test-subdir }}
e2e-node-delete-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}
e2e-node-delete-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-test-subdir }}
e2e-node-upgrade-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-test-subdir }}
e2e-node-upgrade-separate-commands-test-subdir: ${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-test-subdir }}
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
e2e-integration-coverage-report: ${{ needs.env-vars.outputs.e2e-integration-coverage-report }}
e2e-standard-coverage-report: ${{ needs.env-vars.outputs.e2e-standard-coverage-report }}
Expand All @@ -180,9 +187,11 @@ jobs:
e2e-node-add-local-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-local-coverage-report }}
e2e-node-add-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}
e2e-node-update-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}
e2e-node-update-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-update-separate-commands-coverage-report }}
e2e-node-delete-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}
e2e-node-delete-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-delete-separate-commands-coverage-report }}
e2e-node-upgrade-coverage-report: ${{ needs.env-vars.outputs.e2e-node-upgrade-coverage-report }}
e2e-node-upgrade-separate-commands-coverage-report: ${{ needs.env-vars.outputs.e2e-node-upgrade-separate-commands-coverage-report }}
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
secrets:
codacy-project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ tests:
- name: Node Upgrade
mochaPostfix: "'test/e2e/commands/node_upgrade.test.ts'"

- name: Node Upgrade - Separate commands
mochaPostfix: "'test/e2e/commands/separate_node_upgrade.test.ts'"

- name: Relay
mochaPostfix: "'test/e2e/commands/relay.test.ts'"
11 changes: 8 additions & 3 deletions .github/workflows/templates/template.zxc-code-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ jobs:
name: ${{ inputs.custom-job-label || 'Analyze' }}
runs-on: solo-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: ${{ inputs.enable-sonar-analysis && '0' || '' }}
Expand All @@ -112,7 +117,7 @@ jobs:
path: "e2e_test_report"

- name: Publish E2E Test Report
uses: EnricoMi/publish-unit-test-result-action@82082dac68ad6a19d980f8ce817e108b9f496c2a # v2.17.1
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
with:
check_name: "E2E Test Report"
Expand Down Expand Up @@ -185,7 +190,7 @@ jobs:
echo "::endgroup::"
- name: Publish Snyk Reports
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: ${{ inputs.enable-snyk-scan && !cancelled() && !failure() }}
with:
name: Snyk Reports
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/templates/template.zxc-env-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ defaults:
run:
shell: bash

permissions:
contents: read

jobs:
env-vars:
name: ${{ inputs.custom-job-label || 'Set Environment Variables' }}
Expand All @@ -41,4 +44,9 @@ jobs:
# {AUTOGENERATE-JOB-OUTPUTS-SUB-DIRS}
# {AUTOGENERATE-JOB-OUTPUTS-COVERAGE-REPORTS}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit

- run: echo "Exposing environment variables to reusable workflows"
17 changes: 17 additions & 0 deletions .github/workflows/zxc-code-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ on:
type: string
required: false
default: "e2e-node-upgrade"
e2e-node-upgrade-separate-commands-test-subdir:
description: "E2E Node Upgrade - Separate commands Test Subdirectory:"
type: string
required: false
default: "e2e-node-upgrade-separate-commands"
e2e-relay-test-subdir:
description: "E2E Relay Test Subdirectory:"
type: string
Expand Down Expand Up @@ -210,6 +215,11 @@ on:
type: string
required: false
default: "E2E Node Upgrade Tests Coverage Report"
e2e-node-upgrade-separate-commands-coverage-report:
description: "E2E Node Upgrade - Separate commands Coverage Report:"
type: string
required: false
default: "E2E Node Upgrade - Separate commands Tests Coverage Report"
e2e-relay-coverage-report:
description: "E2E Relay Coverage Report:"
type: string
Expand Down Expand Up @@ -370,6 +380,13 @@ jobs:
name: ${{ inputs.e2e-node-upgrade-coverage-report }}
path: 'coverage/${{ inputs.e2e-node-upgrade-test-subdir }}'

- name: Download E2E Node Upgrade - Separate commands Coverage Report
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
with:
name: ${{ inputs.e2e-node-upgrade-separate-commands-coverage-report }}
path: 'coverage/${{ inputs.e2e-node-upgrade-separate-commands-test-subdir }}'

- name: Download E2E Relay Coverage Report
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/zxc-env-vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ on:
e2e-node-upgrade-test-subdir:
description: "E2E Node Upgrade Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_node_upgrade_test_subdir }}
e2e-node-upgrade-separate-commands-test-subdir:
description: "E2E Node Upgrade - Separate commands Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_node_upgrade_separate_commands_test_subdir }}
e2e-relay-test-subdir:
description: "E2E Relay Test Subdirectory"
value: ${{ jobs.env-vars.outputs.e2e_relay_test_subdir }}
Expand Down Expand Up @@ -119,6 +122,9 @@ on:
e2e-node-upgrade-coverage-report:
description: "E2E Node Upgrade Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_node_upgrade_coverage_report }}
e2e-node-upgrade-separate-commands-coverage-report:
description: "E2E Node Upgrade - Separate commands Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_node_upgrade_separate_commands_coverage_report }}
e2e-relay-coverage-report:
description: "E2E Relay Tests Coverage Report"
value: ${{ jobs.env-vars.outputs.e2e_relay_coverage_report }}
Expand Down Expand Up @@ -150,6 +156,7 @@ jobs:
e2e_node_delete_test_subdir: e2e-node-delete
e2e_node_delete_separate_commands_test_subdir: e2e-node-delete-separate-commands
e2e_node_upgrade_test_subdir: e2e-node-upgrade
e2e_node_upgrade_separate_commands_test_subdir: e2e-node-upgrade-separate-commands
e2e_relay_test_subdir: e2e-relay
e2e_integration_coverage_report: "E2E Integration Tests Coverage Report"
e2e_standard_coverage_report: "E2E Standard Tests Coverage Report"
Expand All @@ -166,6 +173,7 @@ jobs:
e2e_node_delete_coverage_report: "E2E Node Delete Tests Coverage Report"
e2e_node_delete_separate_commands_coverage_report: "E2E Node Delete - Separate commands Tests Coverage Report"
e2e_node_upgrade_coverage_report: "E2E Node Upgrade Tests Coverage Report"
e2e_node_upgrade_separate_commands_coverage_report: "E2E Node Upgrade - Separate commands Tests Coverage Report"
e2e_relay_coverage_report: "E2E Relay Tests Coverage Report"
steps:
- name: Harden Runner
Expand Down
Loading

0 comments on commit 1cf5893

Please sign in to comment.