From 4f900631716da43e6faa57b3899b256f6f1709ca Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:39:19 +0100 Subject: [PATCH 1/2] fix running e2e tests manually --- .github/workflows/e2e_testing.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 84ddcf4f..fe395940 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -13,14 +13,20 @@ on: description: 'Test case to run (see e2e_test_cases.yaml for available cases), "all" to run all test cases.' required: false default: 'all' + commitish_to_test: + type: string + description: 'Enter commit hash or branch to test (default: main).' + default: "main" jobs: - determine_test_cases: + parse_inputs: runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'test:e2e') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' outputs: - test_cases: ${{ steps.set-matrix.outputs.test_cases }} + test_cases: ${{ steps.parse-test-cases.outputs.test_cases }} + commitish_to_test: ${{ steps.parse-commitish-to-test.outputs.commitish_to_test }} steps: - - id: set-matrix + - id: parse-test-cases run: | if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.test_case }}" != "all" ]; then echo "test_cases=[\"${{ github.event.inputs.test_case }}\"]" >> $GITHUB_OUTPUT @@ -29,15 +35,21 @@ jobs: echo 'test_cases=["basic", "synchropasef", "astral", "astral_automatic_calibration", "multistep"]' >> $GITHUB_OUTPUT fi - end2end_testing: - name: End to end test - needs: determine_test_cases + - id: parse-commitish-to-test + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "commitish_to_test=[\"${{ github.event.inputs.commitish_to_test }}\"]" >> $GITHUB_OUTPUT + else + echo "commitish_to_test=main" >> $GITHUB_OUTPUT + + end2end_tests: + name: End to end tests + needs: parse_inputs runs-on: self-hosted - if: contains(github.event.pull_request.labels.*.name, 'test:e2e') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: - test_case: ${{ fromJson(needs.determine_test_cases.outputs.test_cases) }} + test_case: ${{ fromJson(needs.parse_inputs.outputs.test_cases) }} env: RUN_NAME: alphadia-${{github.sha}}-${{github.run_id}}-${{github.run_attempt}} BRANCH_NAME: ${{ github.head_ref || github.ref_name }} @@ -49,6 +61,8 @@ jobs: TQDM_MININTERVAL: 10 # avoid lots of tqdm outputs steps: - uses: actions/checkout@v4 + with: + ref: ${{ needs.parse_inputs.outputs.commitish_to_test }} - name: Pip installation (stable) id: pip_installation shell: bash -el {0} From 4a7615d4cb6ab90282810cb4b3639e053b3a18ad Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:40:34 +0100 Subject: [PATCH 2/2] fix running e2e tests manually --- .github/workflows/e2e_testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index fe395940..99890b3a 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -41,6 +41,7 @@ jobs: echo "commitish_to_test=[\"${{ github.event.inputs.commitish_to_test }}\"]" >> $GITHUB_OUTPUT else echo "commitish_to_test=main" >> $GITHUB_OUTPUT + fi end2end_tests: name: End to end tests