Skip to content

Commit

Permalink
make test under CI more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Mar 28, 2024
1 parent 8f39f13 commit 4dacf49
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/+verbose_ci.infrastructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase verbosity when running tests under CI.
13 changes: 11 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def _detect_python_nox_id() -> str:
'test',
]

PYTEST_GLOBAL_ARGS = []
if CI:
PYTEST_GLOBAL_ARGS.append("-vv")


def pdm_install(
session: nox.Session, *groups: str, dev: bool = True, editable: bool = False
Expand Down Expand Up @@ -159,7 +163,7 @@ def lint(session):
# *PY_PATHS,
# )

session.run('pytest', 'test/static')
session.run('pytest', 'test/static', *PYTEST_GLOBAL_ARGS)
session.run('liccheck', '-s', 'pyproject.toml')
session.run('pdm', 'lock', '--check', external=True)

Expand All @@ -177,6 +181,7 @@ def unit(session):
'--cov-branch',
'--cov-report=xml',
'--doctest-modules',
*PYTEST_GLOBAL_ARGS,
*session.posargs,
'test/unit',
]
Expand Down Expand Up @@ -205,6 +210,7 @@ def run_integration_test(session, pytest_posargs):
'INFO',
'-W',
'ignore::DeprecationWarning:rst2ansi.visitor:',
*PYTEST_GLOBAL_ARGS,
*pytest_posargs,
]

Expand Down Expand Up @@ -248,7 +254,10 @@ def test(session):
def cleanup_buckets(session):
"""Remove buckets from previous test runs."""
pdm_install(session, 'test')
session.run('pytest', '-s', '-x', *session.posargs, 'test/integration/cleanup_buckets.py')
session.run(
'pytest', '-s', '-x', *PYTEST_GLOBAL_ARGS, *session.posargs,
'test/integration/cleanup_buckets.py'
)


@nox.session
Expand Down

0 comments on commit 4dacf49

Please sign in to comment.