Simplify test infrastructure - #664
Open
ehelms wants to merge 4 commits into
Open
Conversation
nmap was the only test dependency requiring a package install on the VM. openssl is already present as a Candlepin prerequisite and can probe specific TLS versions directly. Co-Authored-By: Claude <noreply@anthropic.com>
Move ssh-config generation from the forge test Ansible playbook into a session-scoped pytest fixture. This allows running tests directly with pytest or make without going through forge, and removes the only remaining non-trivial work the forge test playbook was doing. Co-Authored-By: Claude <noreply@anthropic.com>
make test runs the full integration suite via pytest. make test-unit runs only the local unit tests with no VM dependency. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
|
There are things in here I think we should do for sure, the open question is testing interface:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are you introducing these changes? (Problem description, related links)
Running tests required going through
forge test, an Ansible playbook whoseonly jobs were installing
nmapon the VM, generating an ssh-config from theinventory, and shelling out to pytest. This indirection made it harder to run
tests directly, required a VM-side package install before every test run, and
obscured what the test runner was actually doing.
What are the changes introduced in this pull request?
nmap --script ssl-enum-ciphersincandlepin_test.pywithopenssl s_clientto verify TLS version support.opensslis alreadypresent on the VM as a Candlepin prerequisite, eliminating the only reason
forge testneeded to install a package on the VM before running tests.forge testinto a session-scoped autousepytest fixture (
generate_ssh_configintests/conftest.py). The fixturereads the static inventory (defaulting to
inventories/local_vagrant,overridable via
OBSAH_INVENTORY) and writes.tmp/ssh-configbefore anytest runs, so pytest can be invoked directly without going through forge.
development/playbooks/test/test.yamlto just run pytest now thatthe nmap install and ssh-config generation are handled elsewhere.
make testandmake test-unittargets as a direct interface to thetest suite.
make testruns the full integration suite;make test-unitruns only
tests/unit/with no VM required.make testinstead of./forge test.How to test this pull request
Steps to reproduce:
Run unit tests locally without a VM:
All tests in
tests/unit/should pass with no VM or deployed environment.Run the full integration suite against a deployed environment:
Confirm
tests/feature/katello/candlepin_test.py::test_tlspasses withoutnmapinstalled on the VM.Confirm
forge teststill works (now a thin wrapper around pytest):Checklist