dev-container: Add subcommand to run tests
This MR has three related commits:
dev-container: Add subcommand to run tests
- Add new subcommand
run-tests
to the ./container script and the --pytest-args argument to pass additional arguments to the pytest command. - Runs tests as root.
- Add new parameters to the SSH command:
- -Y Enable X11 forwarding to be able to run a browser GUI on a container.
- -C Use traffic compression so the X11 GUI is not laggy.
- -t Force pseudo-terminal allocation to enable colors on terminal.
- Use the LogLevel=error option to suppress some warning messages.
- Update module markers in the pytest.ini file.
- Increase the default container disk size to 12G.
- Update HACKING.md to run unit and functional tests.
PROVISION_SCRIPT:
- Explicitly install sshpass as requirement for tests, needed on Debian stable.
- Ensure that geckodriver.log and .pytest_cache/ exist and are others-writable.
Closes #1901 (closed)
Tests performed:
- Run unit tests on stable, testing and unstable containers, no failed tests.
- Run functional tests on stable and testing containers, no regressions.
functional-tests: Fix installation errors in install.sh script
- On Debian 10, pin pytest-bdd version to 3.2.1, this is the latest version that supports pytest 3.10.1.
- Install wheel and pytest-xdist packages from the Debian repos.
- Add git as a dependency for functional tests.
- Fix regexp when getting Gecko version from the Github api, for some reason after colon, sometimes there is a space and sometimes not.
Tests performed on Debian stable, testing and unstable:
- Installing dependencies with the install.sh script succeeds.
- No regressions when running tests.
users: Skip action script tests if LDAP is not set up
- Also, make sure an admin account exists before some tests.
Tests performed:
- The users module test_actions unit tests are skipped if LDAP is not set up.
- The users module unit tests pass if LDAP is set up.
Edited by Veiko Aasa