The Python-based test infrastructure (pytest, tox, testinfra) is replaced
with BATS (Bash Automated Testing System), matching the approach already
used in FTL
Changes:
- Add test/run.sh — single entry point replacing all 15 tox.*.ini files;
accepts DISTRO env var, builds the test image, installs BATS on demand,
and selects test files based on distro family (debian/alpine/rhel)
- Add test/helpers/mocks.bash — bash equivalents of conftest.py's
mock_command*, mock_command_2, and mock_command_passthrough helpers;
uses base64 transfer to write mock scripts into containers safely
- Add test/test_automated_install.bats — replaces test_any_automated_install.py
- Add test/test_utils.bats — replaces test_any_utils.py
- Add test/test_selinux.bats — replaces test_centos_fedora_common_support.py;
only run on CentOS/Fedora (rhel family)
- Remove conftest.py, requirements.txt, setup.py, __init__.py
- Remove all 15 tox.*.ini files
- Remove all three Python test files
- Update .github/workflows/test.yml: drop Python setup, tox invocation,
and black formatting check; distro-test job now runs bash test/run.sh
- Update .gitignore: remove Python-specific entries, add test/libs/
Signed-off-by: PromoFaux <PromoFaux@users.noreply.github.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
* unpin the requirements and update all to latest available - needs more work still. see notes in `def host()`
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
* fix py3 monkey patch of testinfra docker using bash
Signed-off-by: Adam Hill <adam@diginc.us>
* update the other test files to use `host` instead of `Pihole`
Address some sticklr and codefactor
update python version from 3.7 to 3.8
preload `git` onto the centos/fedora test images, and switch which with command -v in the passthrough mock
testinfra is deprecated, use pytest-testinfra
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: Adam Hill <adam@diginc.us>