foundationdb/contrib/pkg_tester
Andrew Noyes 2e8bce04c6 Remove brittle fdbcli help text snapshot test
This seems to be more trouble than value so far.
2022-02-28 15:24:29 -06:00
..
__snapshots__ Merge pull request #6144 from sfc-gh-ajbeamon/unify-flags 2021-12-15 10:47:32 -08:00
README.md Tests pass for versioned packages 2021-08-19 16:32:22 +00:00
requirements.txt Basic tests for rpm and deb packages 2021-08-19 16:32:22 +00:00
test_fdb_pkgs.py Remove brittle fdbcli help text snapshot test 2022-02-28 15:24:29 -06:00

README.md

pkg_tester

This is a test suite that can be used to validate properties of generated package files.

To use it, first build the package files as described in the main README

Then setup a virtualenv:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

Then you can run the tests with pytest:

$ BUILDDIR=<BUILDDIR> python -m pytest -s -v

These are snapshot tests, so you may need to update the snapshots with

$ BUILDDIR=<BUILDDIR> python -m pytest -s -v --snapshot-update

Use discretion about whether or not the behavior change is acceptable.

A helpful tip for debugging: if you run pytest with --pdb, then it will pause the tests at the first error which gives you a chance to run some docker exec commands to try and see what's wrong.

There's a small chance that this will leak an image (especially if you interrupt the test with ctrl-c). Consider running

$ docker image prune

after. If you kill -9 the test, there might even be leaked containers. You can destroy all existing containers with

$ docker rm -f $(docker ps -a -q) # destroy all docker containers!

Requirements

docker, python

Future work?

  • Test rpms
  • Test debs
  • Test versioned packages
  • Test that upgrades preserve data/config

Development

Please run black and mypy after making changes