diff --git a/.github/workflows/devRun.yml b/.github/workflows/devRun.yml index 2b6e8f83df..1221e4049c 100644 --- a/.github/workflows/devRun.yml +++ b/.github/workflows/devRun.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Pre merge test on: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a79dfc21db..89bdc03230 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,6 +1,3 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Nightly regression tests on: @@ -12,10 +9,31 @@ on: description: 'Custom pytest command' required: true default: '-m "not devRun"' + type: string + parallelism: + description: 'Number of machines to split tests' + required: false + default: 2 + type: number jobs: - nightly: + setup-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + run: | + count=${{ github.event.inputs.parallelism || 2 }} + matrix=$(seq -s ',' 1 $count) + echo "matrix=$(jq -cn --argjson groups "[$matrix]" '{group: $groups}')" >> $GITHUB_OUTPUT + + nightly-test: + needs: setup-matrix runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} env: EMAIL: ${{ secrets.EMAIL }} PASSWORD: ${{ secrets.PASSWORD }} @@ -39,16 +57,26 @@ jobs: key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install Dependencies run: poetry install --no-interaction --no-root - - name: Run custom pytest command - if: github.event_name == 'workflow_dispatch' + - name: Run Tests run: | source .venv/bin/activate - xvfb-run pytest ${{ github.event.inputs.pytest_command }} --base-url ${{ vars.BASE_URL }} - - name: Run default pytest command - if: github.event_name != 'workflow_dispatch' + xvfb-run pytest ${{ github.event.inputs.pytest_command || '-m "not devRun"' }} \ + --base-url ${{ vars.BASE_URL }} \ + --splits ${{ github.event.inputs.parallelism || 2 }} \ + --group ${{ matrix.group }} + + merge-reports: + needs: nightly-test + if: always() + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Merge Allure Results run: | - source .venv/bin/activate - xvfb-run pytest -m "not devRun" --base-url ${{ vars.BASE_URL }} + mkdir -p allure-results + for dir in artifacts/test-results-*/allure-results; do + cp -r $dir/* allure-results/ + done - name: Link Git Information And Browser Version To Allure Report working-directory: allure-results if: always()