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

Skip tests with unsatisfied deps #55853

Merged
merged 4 commits into from
Jun 28, 2019

Conversation

abadger
Copy link
Contributor

@abadger abadger commented Apr 28, 2019

SUMMARY

Tests for modules or other plugins whose deps fall outside of ansible's core dependency set need to check whether the deps are installed and skip if they are not.

This PR skips for several tests which were found to be running even when their deps were not installed.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

backport to 2.8 when merged.

@abadger
Copy link
Contributor Author

abadger commented Apr 28, 2019

\cc @mattclay

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 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. support:core This issue/PR relates to code supported by the Ansible Engineering Team. 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 Apr 28, 2019
@abadger
Copy link
Contributor Author

abadger commented Apr 28, 2019

@mattclay I'm not quite sure why the cloudstack test is failing now.... The pytestmark to skip the test on python-2.6 is functioning correctly locally. I can change it to skip the test if it's on python-2.6 in a different way (it was using unittest before).... I'm just not sure why this syntax is failing in our setup.

@abadger abadger force-pushed the skip-tests-with-unsatisfied-deps branch 5 times, most recently from e342ee2 to 901ce52 Compare April 28, 2019 03:53
@abadger
Copy link
Contributor Author

abadger commented Apr 28, 2019

@mattclay, I figured out what my mistake was. The test was failing when it tested whether it could import the cs module. The toplevel code in the test all runs and registers whether any of the conditions would cause it to skip. Since I was trying to import cs to test for its availabilty, it was failing with a SyntaxError on python-2.6. I moved that test for whether to skip inside of the condition for python-2.6 so that it only runs on Python-2.7+

Should work now! 🤞

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 28, 2019
@abadger
Copy link
Contributor Author

abadger commented Apr 30, 2019

ready_for_review :-)

@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Apr 30, 2019
@samdoran samdoran requested a review from mattclay April 30, 2019 15:25
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label May 8, 2019
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html 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 Jun 23, 2019
@abadger abadger force-pushed the skip-tests-with-unsatisfied-deps branch from 901ce52 to 9d6266f Compare June 28, 2019 19:41
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Jun 28, 2019
@abadger abadger merged commit 8acf71f into ansible:devel Jun 28, 2019
@abadger abadger deleted the skip-tests-with-unsatisfied-deps branch June 28, 2019 20:09
abadger added a commit to abadger/ansible that referenced this pull request Jun 29, 2019
* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it
(cherry picked from commit 8acf71f)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
abadger added a commit that referenced this pull request Jun 29, 2019
* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it
(cherry picked from commit 8acf71f)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
agowa pushed a commit to agowa/ansible-1 that referenced this pull request Jun 30, 2019
* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it
abadger added a commit to abadger/ansible that referenced this pull request Jul 1, 2019
* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it.
(cherry picked from commit 8acf71f)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
abadger added a commit that referenced this pull request Jul 1, 2019
* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it.
(cherry picked from commit 8acf71f)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
abadger added a commit to abadger/ansible that referenced this pull request Jul 1, 2019
…5853)

* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it.
(cherry picked from commit 8acf71f)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>.
(cherry picked from commit 7d4e9b2)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. 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