From 80701f4fc125db4009c96175732a1ef573dd7525 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Sun, 2 Jun 2024 19:56:07 +0100 Subject: [PATCH] Add ``pytest.ini`` files to all packages Previously, when running pytest from `packages/test.sh`, it was using our main `pytest.ini` as configfile, therefore setting the wrong rootdir and using `lib` as `pythonpath`. This was hiding various packaging issues fixed in the previous commits. --- packages/app/pytest.ini | 3 +-- packages/auth/pytest.ini | 1 + packages/config/pytest.ini | 1 + packages/data/pytest.ini | 1 + packages/files/pytest.ini | 1 + packages/job_execution/pytest.ini | 1 + packages/job_metrics/pytest.ini | 1 + packages/meta/pytest.ini | 1 + packages/navigation/pytest.ini | 1 + packages/objectstore/pytest.ini | 1 + packages/package-pytest.ini | 6 ++++++ packages/schema/pytest.ini | 1 + packages/selenium/pytest.ini | 1 + packages/test.sh | 5 +---- packages/test_api/pytest.ini | 1 + packages/test_base/pytest.ini | 1 + packages/test_driver/pytest.ini | 1 + packages/test_selenium/pytest.ini | 1 + packages/tool_shed/pytest.ini | 1 + packages/tool_util/pytest.ini | 1 + packages/tours/pytest.ini | 1 + packages/util/pytest.ini | 1 + packages/web_apps/pytest.ini | 1 + packages/web_framework/pytest.ini | 1 + packages/web_stack/pytest.ini | 1 + 25 files changed, 30 insertions(+), 6 deletions(-) mode change 100644 => 120000 packages/app/pytest.ini create mode 120000 packages/auth/pytest.ini create mode 120000 packages/config/pytest.ini create mode 120000 packages/data/pytest.ini create mode 120000 packages/files/pytest.ini create mode 120000 packages/job_execution/pytest.ini create mode 120000 packages/job_metrics/pytest.ini create mode 120000 packages/meta/pytest.ini create mode 120000 packages/navigation/pytest.ini create mode 120000 packages/objectstore/pytest.ini create mode 100644 packages/package-pytest.ini create mode 120000 packages/schema/pytest.ini create mode 120000 packages/selenium/pytest.ini create mode 120000 packages/test_api/pytest.ini create mode 120000 packages/test_base/pytest.ini create mode 120000 packages/test_driver/pytest.ini create mode 120000 packages/test_selenium/pytest.ini create mode 120000 packages/tool_shed/pytest.ini create mode 120000 packages/tool_util/pytest.ini create mode 120000 packages/tours/pytest.ini create mode 120000 packages/util/pytest.ini create mode 120000 packages/web_apps/pytest.ini create mode 120000 packages/web_framework/pytest.ini create mode 120000 packages/web_stack/pytest.ini diff --git a/packages/app/pytest.ini b/packages/app/pytest.ini deleted file mode 100644 index 6b5e4056f66f..000000000000 --- a/packages/app/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -addopts = --ignore-glob 'galaxy/tools/bundled/*' diff --git a/packages/app/pytest.ini b/packages/app/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/app/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/auth/pytest.ini b/packages/auth/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/auth/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/config/pytest.ini b/packages/config/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/config/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/data/pytest.ini b/packages/data/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/data/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/files/pytest.ini b/packages/files/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/files/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/job_execution/pytest.ini b/packages/job_execution/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/job_execution/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/job_metrics/pytest.ini b/packages/job_metrics/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/job_metrics/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/meta/pytest.ini b/packages/meta/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/meta/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/navigation/pytest.ini b/packages/navigation/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/navigation/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/objectstore/pytest.ini b/packages/objectstore/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/objectstore/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/package-pytest.ini b/packages/package-pytest.ini new file mode 100644 index 000000000000..34f513224dcf --- /dev/null +++ b/packages/package-pytest.ini @@ -0,0 +1,6 @@ +[pytest] +# Prevent execution of alembic/env.py at test collection stage (alembic.context not set). +# Also ignore functional tests (galaxy_test/ and tool_shed/test/). +addopts = --doctest-modules --ignore=galaxy/model/migrations/alembic/ --ignore=galaxy/tools/bundled/ --ignore=galaxy_test/ --ignore=tool_shed/test/ --ignore=tool_shed/webapp/model/migrations/alembic/ --doctest-continue-on-failure --verbosity=1 +asyncio_mode = auto +log_level = DEBUG diff --git a/packages/schema/pytest.ini b/packages/schema/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/schema/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/selenium/pytest.ini b/packages/selenium/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/selenium/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/test.sh b/packages/test.sh index be98e038285e..d2ed377c352b 100755 --- a/packages/test.sh +++ b/packages/test.sh @@ -63,11 +63,8 @@ while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow. else marker_args=() fi - # Prevent execution of alembic/env.py at test collection stage (alembic.context not set) - # Also ignore functional tests (galaxy_test/ and tool_shed/test/). - unit_extra=(--doctest-modules --ignore=galaxy/model/migrations/alembic/ --ignore=galaxy_test/ --ignore=tool_shed/test/ --ignore=tool_shed/webapp/model/migrations/alembic/ "${marker_args[@]}") # Ignore exit code 5 (no tests ran) - pytest "${unit_extra[@]}" . || test $? -eq 5 + pytest "${marker_args[@]}" . || test $? -eq 5 if [ $FOR_PULSAR -eq 0 ]; then make mypy fi diff --git a/packages/test_api/pytest.ini b/packages/test_api/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/test_api/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/test_base/pytest.ini b/packages/test_base/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/test_base/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/test_driver/pytest.ini b/packages/test_driver/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/test_driver/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/test_selenium/pytest.ini b/packages/test_selenium/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/test_selenium/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/tool_shed/pytest.ini b/packages/tool_shed/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/tool_shed/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/tool_util/pytest.ini b/packages/tool_util/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/tool_util/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/tours/pytest.ini b/packages/tours/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/tours/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/util/pytest.ini b/packages/util/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/util/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/web_apps/pytest.ini b/packages/web_apps/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/web_apps/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/web_framework/pytest.ini b/packages/web_framework/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/web_framework/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file diff --git a/packages/web_stack/pytest.ini b/packages/web_stack/pytest.ini new file mode 120000 index 000000000000..d1bd969dce80 --- /dev/null +++ b/packages/web_stack/pytest.ini @@ -0,0 +1 @@ +../package-pytest.ini \ No newline at end of file