Skip to content

Commit

Permalink
Add pytest.ini files to all packages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nsoranzo committed Jun 2, 2024
1 parent 1174bbe commit 80701f4
Show file tree
Hide file tree
Showing 25 changed files with 30 additions and 6 deletions.
2 changes: 0 additions & 2 deletions packages/app/pytest.ini

This file was deleted.

1 change: 1 addition & 0 deletions packages/app/pytest.ini
1 change: 1 addition & 0 deletions packages/auth/pytest.ini
1 change: 1 addition & 0 deletions packages/config/pytest.ini
1 change: 1 addition & 0 deletions packages/data/pytest.ini
1 change: 1 addition & 0 deletions packages/files/pytest.ini
1 change: 1 addition & 0 deletions packages/job_execution/pytest.ini
1 change: 1 addition & 0 deletions packages/job_metrics/pytest.ini
1 change: 1 addition & 0 deletions packages/meta/pytest.ini
1 change: 1 addition & 0 deletions packages/navigation/pytest.ini
1 change: 1 addition & 0 deletions packages/objectstore/pytest.ini
6 changes: 6 additions & 0 deletions packages/package-pytest.ini
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions packages/schema/pytest.ini
1 change: 1 addition & 0 deletions packages/selenium/pytest.ini
5 changes: 1 addition & 4 deletions packages/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/test_api/pytest.ini
1 change: 1 addition & 0 deletions packages/test_base/pytest.ini
1 change: 1 addition & 0 deletions packages/test_driver/pytest.ini
1 change: 1 addition & 0 deletions packages/test_selenium/pytest.ini
1 change: 1 addition & 0 deletions packages/tool_shed/pytest.ini
1 change: 1 addition & 0 deletions packages/tool_util/pytest.ini
1 change: 1 addition & 0 deletions packages/tours/pytest.ini
1 change: 1 addition & 0 deletions packages/util/pytest.ini
1 change: 1 addition & 0 deletions packages/web_apps/pytest.ini
1 change: 1 addition & 0 deletions packages/web_framework/pytest.ini
1 change: 1 addition & 0 deletions packages/web_stack/pytest.ini

0 comments on commit 80701f4

Please sign in to comment.