Skip tests for features not enabled and show pytest results#485
Open
ehelms wants to merge 1 commit intotheforeman:masterfrom
Open
Skip tests for features not enabled and show pytest results#485ehelms wants to merge 1 commit intotheforeman:masterfrom
ehelms wants to merge 1 commit intotheforeman:masterfrom
Conversation
Add get_enabled_features() and has_feature() helpers to conftest.py that replicate the Ansible enabled_features calculation by combining flavor_features with user features from parameters.yaml. Use pytest.mark.skipif to gate tests on their required features: foreman-proxy, hammer, azure-rm, google, remote-execution, and iop. Read the Foreman admin password from .var/lib/foremanctl/foreman-admin-init-passwd instead of hardcoding. Update the test playbook to display pytest output before failing so pass/fail details are visible in Ansible output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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)
When certain features are not enabled, their tests are marked as failed which can make debugging confusing.
What are the changes introduced in this pull request?
.var/lib/foremanctl/foreman-admin-init-passwdinstead of hardcoding.How to test this pull request
Steps to reproduce:
foremanctl deploy --add-feature iopChecklist