Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make test-module use default value for interpreter #54053

Merged
merged 3 commits into from Apr 10, 2019
Merged

Make test-module use default value for interpreter #54053

merged 3 commits into from Apr 10, 2019

Conversation

karolistamutis
Copy link
Contributor

SUMMARY

Since #50163 changes to Python interpreter discovery Ansible attempts to use the interpreter from discovered facts, however fact discovery is not performed in test-module, facts dict is empty, thus invocation always fails with ansible.executor.interpreter_discovery.InterpreterDiscoveryRequiredError raised in https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/module_common.py#L496.

That is, unless -I or -interpreter is passed to test-module for every run, making this a required param. Rather than this being required we might consider defaulting to /usr/bin/python as was before, for module test purposes.

Test system: macOS 10.14.3, Python 2.7.15.

ISSUE TYPE
  • Bugfix Pull Request

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 19, 2019
Copy link
Member

@nitzmahone nitzmahone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this definitely was an unintended breakage with interpreter discovery... Inheriting the Python running the test makes most sense to me, but open for discussion if you have other ideas.

hacking/test-module Outdated Show resolved Hide resolved
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Mar 22, 2019
@sivel
Copy link
Member

sivel commented Apr 2, 2019

Can you please add a simple integration test to verify this functionality and ensure we do not break this again.

@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Apr 2, 2019
@karolistamutis
Copy link
Contributor Author

@sivel I've added a simple check to test/integration/targets/test_infra/runme.sh which will be caught by "set -e" if unclean exit, hope that's the right place to check test-module integrity? Cheers

@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Apr 10, 2019
@sivel sivel merged commit 54384e7 into ansible:devel Apr 10, 2019
@karolistamutis karolistamutis deleted the fix_test_module_interpreter_discovery branch April 11, 2019 08:06
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. small_patch support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants