From 51cdaff03da9ba842e3630165a43e2aa1407d843 Mon Sep 17 00:00:00 2001 From: tarek-y-ismail Date: Mon, 5 Aug 2024 16:25:31 +0300 Subject: [PATCH] Only test 1.0, 1.5, and 2.0 scales MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MichaƂ Sawicz --- .github/workflows/test.yml | 25 +++++++++++-------- .../mir_ci/tests/test_fractional_scale_v1.py | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 130fb86d..7054b4c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,14 +61,19 @@ jobs: with: lfs: true - - id: pytest-args - name: Determine pytest arguments + - id: vars + name: Determine variables run: | - ARGS=( --verbose --capture=no ) - [ -n '${{ matrix.server }}' ] && ARGS+=( -k ${{ matrix.server }} ) - [ -n '${{ matrix.mark }}' ] && ARGS+=( -m ${{ matrix.mark }} ) - [ '${{ matrix.mark }}' == 'self' ] && ARGS+=( --cov --cov-branch --cov-report=xml ) - echo args=${ARGS[@]} >> $GITHUB_OUTPUT + PYTEST_ARGS=( --verbose --capture=no ) + [ -n '${{ matrix.server }}' ] && PYTEST_ARGS+=( -k ${{ matrix.server }} ) + [ -n '${{ matrix.mark }}' ] && PYTEST_ARGS+=( -m ${{ matrix.mark }} ) + [ '${{ matrix.mark }}' == 'self' ] && PYTEST_ARGS+=( --cov --cov-branch --cov-report=xml ) + echo pytest_args=${PYTEST_ARGS[@]} >> $GITHUB_OUTPUT + + ARTIFACT_KEY="${{ matrix.server || matrix.mark }}" + [ -n '${{ matrix.channel }}' ] && ARTIFACT_KEY+="-$( echo ${{ matrix.channel }} | tr / _ ) )" + [ -n '${{ matrix.ppa }}' ] && ARTIFACT_KEY+="-$( echo ${{ matrix.ppa }} | tr / _ ) )" + echo artifact_key=${ARTIFACT_KEY[@]} >> $GITHUB_OUTPUT - name: Set up dependencies working-directory: mir-ci/mir_ci @@ -78,7 +83,7 @@ jobs: sudo apt-get --yes install pkg-config libwayland-dev ffmpeg pip install -e .. [ '${{ matrix.mark }}' == 'self' ] && pip install pytest-cov - python -m pytest ${{ steps.pytest-args.outputs.args }} --deps + python -m pytest ${{ steps.vars.outputs.pytest-args }} --deps - name: Run the tests working-directory: mir-ci/mir_ci @@ -97,7 +102,7 @@ jobs: uses: actions/upload-artifact@v4 if: success() || failure() with: - name: test-results-${{ matrix.server && format('{0}-{1}-{2}', matrix.server, matrix.channel, matrix.ppa) || matrix.mark }} + name: test-results-${{ steps.vars.outputs.artifact_key }} path: | mir-ci/mir_ci/junit-*.xml /tmp/pytest-of-*/*-current/**/log.html @@ -120,7 +125,7 @@ jobs: name: Upload any core dumps uses: actions/upload-artifact@v4 with: - name: core-dumps-${{ matrix.server && format('{0}-{1}-{2}', matrix.server, matrix.channel, matrix.ppa) || matrix.mark }} + name: core-dumps-${{ steps.vars.outputs.artifact_key }} path: corefile-* if-no-files-found: ignore diff --git a/mir-ci/mir_ci/tests/test_fractional_scale_v1.py b/mir-ci/mir_ci/tests/test_fractional_scale_v1.py index f4ee6543..f87f41b4 100644 --- a/mir-ci/mir_ci/tests/test_fractional_scale_v1.py +++ b/mir-ci/mir_ci/tests/test_fractional_scale_v1.py @@ -73,7 +73,7 @@ def get_display_config(scale: float) -> dict: ) @pytest.mark.env(GSETTINGS_BACKEND="keyfile") @pytest.mark.parametrize("server", servers(ServerCap.FLOATING_WINDOWS | ServerCap.DISPLAY_CONFIG)) -@pytest.mark.parametrize("scale", [1.0, 1.25, 1.5, 1.75, 2.0]) +@pytest.mark.parametrize("scale", [1.0, 1.5, 2.0]) @pytest.mark.deps( debs=("gtk-4-examples",), pip_pkgs=(