You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For speed h doesn't clear the DB between functests, see:
#6845
As a defence against tests becoming dependent on data left in the DB by
the tests that run before them, we ran the functests in reverse order on
CI (but in normal order in dev). This was achieved by adding the
`pytest-reverse` dependency and adding `--reverse` to the `pytest`
command in CI. See: #7013
The `--reverse` was later accidentally removed by #8264
The cookiecutter has since been applied to h and the cookiecutter doesn't
do the `--reverse` either.
The cookiecutter's `ci.yml` doesn't provide a way for an individual
project to add a command line argument to the `pytest` command for the
functests.
One solution would be to add such an option to the cookiecutter, but
it's awkward and I don't like adding too many options to the
cookiecutter.
Another solution would be to add the `pytest-reverse` dependency and
`--reverse` argument to the cookiecutter and have it be applied to all
projects. This could be a good option, but [pytest-reverse](https://github.com/adamchainz/pytest-reverse)
is a third-party pytest plugin not an official one, and not very
popular, so perhaps we don't want to depend on it in every repo. Also,
all our other projects reset the DB before each unittest of functest so
they have no need for `pytest-reverse`. If we ever fix h to reset the DB
before each functest we'll remove the `pytest-reverse` dependency from h
as well.
This commit goes for a third option: run the tests in reverse _in
development_ rather than on CI, which we can easily do with the
cookiecutter's existing functionality for per-project customisation of
the `PYTEST_ADDOPTS` option.
wip
0 commit comments