From 837d3117457d422c1a45e6cd7aad7aacfa4bc650 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Wed, 8 Jul 2026 09:54:00 +0100 Subject: [PATCH] Fix check_test_class_names test I broke the CI workflow by mistake in commit 37884246444a1d57ced955519b2f277bdbf46691 . While fixing that, I noticed that the `.ci/check_test_class_names.sh` script wasn't properly collecting integration and integration Selenium tests because of these errors: ``` ERROR test/integration - Failed: Defining 'pytest_plugins' in a non-top-level conftest is no longer supported: ERROR test/integration_selenium - Failed: Defining 'pytest_plugins' in a non-top-level conftest is no longer supported: ``` Fixed them by passing to `pytest` all the direct subdirectories instead of `test/`. --- .ci/check_test_class_names.sh | 6 ++++-- .github/workflows/check_test_class_names.yaml | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.ci/check_test_class_names.sh b/.ci/check_test_class_names.sh index 939eb6c1702..6bca1ecc3a6 100755 --- a/.ci/check_test_class_names.sh +++ b/.ci/check_test_class_names.sh @@ -1,9 +1,11 @@ #!/bin/sh +set -e + TEST=$(mktemp) TEST_EXTRA_CLASSES=$(mktemp) -pytest --collect-only --ignore=test/functional lib/galaxy_test/ test/ > "$TEST" -pytest -o python_classes='Test* *Test *TestCase' --collect-only --ignore=test/functional lib/galaxy_test/ test/ > "$TEST_EXTRA_CLASSES" +pytest --collect-only --ignore=test/functional lib/galaxy_test/ $(find test/ -mindepth 1 -maxdepth 1 -type d) > "$TEST" +pytest -o python_classes='Test* *Test *TestCase' --collect-only --ignore=test/functional lib/galaxy_test/ $(find test/ -mindepth 1 -maxdepth 1 -type d) > "$TEST_EXTRA_CLASSES" n_tests=$(grep 'tests collected' "$TEST" | sed -e 's/[^0-9]*\([0-9]*\) tests collected.*/\1/') n_tests_extra_classes=$(grep 'tests collected' "$TEST_EXTRA_CLASSES" | sed -e 's/[^0-9]*\([0-9]*\) tests collected.*/\1/') diff --git a/.github/workflows/check_test_class_names.yaml b/.github/workflows/check_test_class_names.yaml index 924a3c9998a..b44019f0009 100644 --- a/.github/workflows/check_test_class_names.yaml +++ b/.github/workflows/check_test_class_names.yaml @@ -3,6 +3,7 @@ on: pull_request: paths: - '.ci/check_test_class_names.sh' + - .github/workflows/check_test_class_names.yaml - 'lib/galaxy_test/**' - 'test/**' concurrency: @@ -24,9 +25,12 @@ jobs: uses: astral-sh/setup-uv@v8.2.0 with: python-version: ${{ matrix.python-version }} - - name: Install Python - run: uv python install - name: Install Python dependencies - run: uv pip install --system -r requirements.txt -r lib/galaxy/dependencies/pinned-test-requirements.txt + run: | + uv venv .venv + . .venv/bin/activate + uv pip install -r requirements.txt -r lib/galaxy/dependencies/pinned-test-requirements.txt - name: Run tests - run: .ci/check_test_class_names.sh + run: | + . .venv/bin/activate + .ci/check_test_class_names.sh