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

Open
wants to merge 4 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@abadger
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

commented Apr 28, 2019

\cc @mattclay

@abadger

This comment has been minimized.

Copy link
Member Author

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 abadger:skip-tests-with-unsatisfied-deps branch 3 times, most recently from be14893 to 43192e9 Apr 28, 2019

@abadger abadger force-pushed the abadger:skip-tests-with-unsatisfied-deps branch from 43192e9 to e342ee2 Apr 28, 2019

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 abadger force-pushed the abadger:skip-tests-with-unsatisfied-deps branch from e342ee2 to 901ce52 Apr 28, 2019

@abadger

This comment has been minimized.

Copy link
Member Author

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 and removed needs_revision labels Apr 28, 2019

@abadger

This comment has been minimized.

Copy link
Member Author

commented Apr 30, 2019

ready_for_review :-)

@samdoran samdoran removed the needs_triage label Apr 30, 2019

@samdoran samdoran requested a review from mattclay Apr 30, 2019

@ansibot ansibot added the stale_ci label May 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.