1- # This workflow will install Python dependencies, run tests and lint with a single version of Python
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41name : Nightly regression tests
52
63on :
129 description : ' Custom pytest command'
1310 required : true
1411 default : ' -m "not devRun"'
12+ type : string
13+ parallelism :
14+ description : ' Number of machines to split tests'
15+ required : false
16+ default : 2
17+ type : number
1518
1619jobs :
17- nightly :
20+ setup-matrix :
21+ runs-on : ubuntu-latest
22+ outputs :
23+ matrix : ${{ steps.set-matrix.outputs.matrix }}
24+ steps :
25+ - id : set-matrix
26+ run : |
27+ count=${{ github.event.inputs.parallelism || 2 }}
28+ matrix=$(seq -s ',' 1 $count)
29+ echo "matrix=$(jq -cn --argjson groups "[$matrix]" '{group: $groups}')" >> $GITHUB_OUTPUT
30+
31+ nightly-test :
32+ needs : setup-matrix
1833 runs-on : ubuntu-latest
34+ strategy :
35+ fail-fast : false
36+ matrix : ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
1937 env :
2038 EMAIL : ${{ secrets.EMAIL }}
2139 PASSWORD : ${{ secrets.PASSWORD }}
@@ -39,16 +57,26 @@ jobs:
3957 key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
4058 - name : Install Dependencies
4159 run : poetry install --no-interaction --no-root
42- - name : Run custom pytest command
43- if : github.event_name == 'workflow_dispatch'
60+ - name : Run Tests
4461 run : |
4562 source .venv/bin/activate
46- xvfb-run pytest ${{ github.event.inputs.pytest_command }} --base-url ${{ vars.BASE_URL }}
47- - name : Run default pytest command
48- if : github.event_name != 'workflow_dispatch'
63+ xvfb-run pytest ${{ github.event.inputs.pytest_command || '-m "not devRun"' }} \
64+ --base-url ${{ vars.BASE_URL }} \
65+ --splits ${{ github.event.inputs.parallelism || 2 }} \
66+ --group ${{ matrix.group }}
67+
68+ merge-reports :
69+ needs : nightly-test
70+ if : always()
71+ runs-on : ubuntu-latest
72+ steps :
73+ - uses : actions/checkout@v4
74+ - name : Merge Allure Results
4975 run : |
50- source .venv/bin/activate
51- xvfb-run pytest -m "not devRun" --base-url ${{ vars.BASE_URL }}
76+ mkdir -p allure-results
77+ for dir in artifacts/test-results-*/allure-results; do
78+ cp -r $dir/* allure-results/
79+ done
5280 - name : Link Git Information And Browser Version To Allure Report
5381 working-directory : allure-results
5482 if : always()
0 commit comments