Closed 0-wiz-0 closed 1 month ago
The self-tests (a few quick tests) will run automatically each time you use borg.
We did not make any special provisions so that you can run the tests from the pypi package yet.
The tests need some addtl. packages, see requirements.d/development.txt
and regularly run on github actions for each commit / pull request. Developers also can run them locally after doing a git checkout of the repo and setting up the environment as described in the install docs ("from source").
Also, when doing a release, I do vagrant-based platform testing, including on netbsd.
If you want to help with the netbsd situation, see #5922.
Trying to make this work for borg 1.4:
# optional: create and use a virtual env:
python3 -m venv env
. env/bin/activate
# install packages
pip install borgbackup-from-pypi.tgz
pip install pytest pytest-benchmark
# method A: use a pytest.ini
cat >pytest.ini <<<EOF
[pytest]
python_files = testsuite/*.py
markers = allow_cache_wipe
addopts = -v -rs --benchmark-skip
EOF
pytest --pyargs borg.testsuite
# method B: give the options via the cmdline (each time you invoke the tests):
pytest -v -rs --benchmark-skip -o 'python_files=testsuite/*.py' -o 'markers=allow_cache_wipe' --pyargs borg.testsuite
After #8452 is merged (master branch / borg2):
pytest -v -rs --benchmark-skip --pyargs borg.testsuite
I've updated the pkgsrc package, which is using the pypi distfile, to 1.2.0 and wanted to run the self tests to verify that the package works as expected.
I tried the following:
but this reported
Then I tried using pytest, but got another error:
What is the proper way to run the tests from the pypi distfile?
Environment: NetBSD 9.99.93/amd64, python 3.10.2, zstd 1.5.2, lz4 1.9.3, libb2 0.98.1, cython 0.29.27, msgpack 1.0.3, pytest 7.0.1.