Introduce --test-target to more explicitly declare where tests run - #715
Draft
evgeni wants to merge 1 commit into
Draft
Introduce --test-target to more explicitly declare where tests run#715evgeni wants to merge 1 commit into
evgeni wants to merge 1 commit into
Conversation
This does not (yet) change the `server` fixture
Member
Author
jeremylenz
reviewed
Jul 31, 2026
| def server(server_hostname): | ||
| yield get_paramiko_host(server_hostname) | ||
| def server(test_target): | ||
| yield get_paramiko_host(test_target) |
Contributor
There was a problem hiding this comment.
With this in place, it'd be a small change to also support --test-target=localhost for testing deploy-dev setups — just branch on the hostname in get_paramiko_host:
def get_paramiko_host(hostname):
if hostname == 'localhost':
return testinfra.get_host('local://', sudo=True)
return testinfra.get_host(f'paramiko://{hostname}', sudo=True, ssh_config=SSH_CONFIG)Since deploy-dev already supports --target-host=localhost, this would make the test side consistent with it.
Member
Author
There was a problem hiding this comment.
Sure, if that works that sounds like a good addition
2 tasks
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)
Using
--server-hostnamealways felt wrong, as we're not actually changing the hostname of the (Foreman) server, just the system we're running the tests against.What are the changes introduced in this pull request?
--test-targetwhich now declares what theserverfixture points at--server-hostnameremains if we ever need to change the server nameserverfixture, refactoring this is left for laterHow to test this pull request
Steps to reproduce:
Checklist