Skip to content

Commit

Permalink
Merge pull request #440 from MannLabs/fix_running_e2e_manually
Browse files Browse the repository at this point in the history
fix running e2e tests manually
  • Loading branch information
mschwoer authored Jan 17, 2025
2 parents 0f64c9a + 4a7615d commit c1fce43
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/e2e_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,15 +35,22 @@ 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
fi
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 }}
Expand All @@ -49,6 +62,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}
Expand Down

0 comments on commit c1fce43

Please sign in to comment.