-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Create a new pytest folder for live system testing with normal services #15688
Conversation
Progress
this is almost certainly because it is still pulling the image, and increasing the timeout should do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome addition. Loving the README.md
Quality Gate passedIssues Measures |
@@ -0,0 +1,3 @@ | |||
# This file is needed to undo the pytest settings from the project root | |||
[pytest] | |||
addopts = -p no:django -p awx.main.tests.live.pytest_django_config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what unsets DJANGO_SETTINGS_MODULE
from awx/pytest.ini? is that what "no:django" does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, it only respects the pytest.ini
from the current directory, and you can only run these from the awx/main/tests/live
directory. So the pytest.ini
from a parent folder won't even be considered.
Using -p no:django
disables the plugin "django", which has pytest_
prefixed, so the full plugin name is pytest_django
. So this disables the pytest-django, it is installed as a library but pytest doesn't load it as a plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay thanks for the explanation
SUMMARY
This is intended to solve the problem of testing job-related behaviors.
The idea is to keep using as much of our normal testing system as possible, but not use the test database system. This is difficult with
pytest-django
installed. I can do it by creating a new test folder, and doing acd
into that. I've thought about it, and I'm willing to pay that price.So I want to uninstall pytest-django, but without actually uninstalling it. I just take all its critical connection points and throw them in the trash. This means that the tests will operate directly on the database, unprotected. Just the way I like it. It is very easy to break things in this state, and that is just what we will do.
Unlike
make test
, this newmake live_test
can only be ran as a part ofmake docker-compose
. That rule seems easy enough to me. It's honestly weird thatmake test
runs in a single awx_devel container. If you were going to do that, don't bother with a container in the first place?My demo test bypasses uWSGI, because didn't need it. It borrows the mock request fixtures we already have to make a "request". Why? Because it works. The task manager gets the message, dispatches it, and it does the full job lifecycle, events and all.
We want a philosophy of a test environment as isolated as reasonable, while still being useful. Because of that, it is never envisioned that we would make true API requests with this. It has the ORM, and everything can be done with that. The core goal of these tests are to see custody of jobs passed to the dispatcher/receptor/runner stack and test for outcomes in both the database and filesystem.
ISSUE TYPE