From 8ebdd04a890c314ab2e50e9cb17ba4dfc44b2021 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:51:45 +0200 Subject: [PATCH 1/3] fix: poetry tests runs failing --- tests-pytest/action.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests-pytest/action.yml b/tests-pytest/action.yml index 5dc587da..ce058d27 100644 --- a/tests-pytest/action.yml +++ b/tests-pytest/action.yml @@ -241,16 +241,25 @@ runs: python -m pip install .[tests] fi - - name: "Executing test suite without using xvfb" - if: inputs.requires-xvfb == 'false' + - name: "Set up pytest run command" + shell: bash + run: | + if [[ ${{ env.BUILD_BACKEND }} == 'poetry' ]]; then + echo "PYTEST_RUN=$(echo 'poetry run pytest')" >> $GITHUB_ENV + else + echo "PYTEST_RUN=$(echo 'python -m pytest')" >> $GITHUB_ENV + fi + + - name: "Executing test suite" shell: bash run: | ${{ env.ACTIVATE_VENV }} - pytest ${{ inputs.pytest-markers }} ${{ inputs.pytest-extra-args }} ${{ inputs.pytest-postargs }} + ${{ env.PYTEST_RUN }} ${{ inputs.pytest-markers }} ${{ inputs.pytest-extra-args }} ${{ inputs.pytest-postargs }} + - name: "Executing test suite using xvfb" if: inputs.requires-xvfb == 'true' shell: bash run: | ${{ env.ACTIVATE_VENV }} - xvfb-run pytest ${{ inputs.pytest-markers }} ${{ inputs.pytest-extra-args }} ${{ inputs.pytest-postargs }} + xvfb-run ${{ env.PYTEST_RUN }} ${{ inputs.pytest-markers }} ${{ inputs.pytest-extra-args }} ${{ inputs.pytest-postargs }} From fa78fa791e9d680c6559b8bd8a2664740ca09b54 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:24:18 +0200 Subject: [PATCH 2/3] fix: missing conditional --- tests-pytest/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests-pytest/action.yml b/tests-pytest/action.yml index ce058d27..4bf7696d 100644 --- a/tests-pytest/action.yml +++ b/tests-pytest/action.yml @@ -251,6 +251,7 @@ runs: fi - name: "Executing test suite" + if: inputs.requires-xvfb == 'false' shell: bash run: | ${{ env.ACTIVATE_VENV }} From 51506ca0d9ca7a0965cf44c58277f1523d409266 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:25:12 +0200 Subject: [PATCH 3/3] Update tests-pytest/action.yml --- tests-pytest/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests-pytest/action.yml b/tests-pytest/action.yml index 4bf7696d..3fdc9414 100644 --- a/tests-pytest/action.yml +++ b/tests-pytest/action.yml @@ -257,7 +257,6 @@ runs: ${{ env.ACTIVATE_VENV }} ${{ env.PYTEST_RUN }} ${{ inputs.pytest-markers }} ${{ inputs.pytest-extra-args }} ${{ inputs.pytest-postargs }} - - name: "Executing test suite using xvfb" if: inputs.requires-xvfb == 'true' shell: bash