Some test cases covering parts of the HTTP API had crept into test_policies.py, which is supposed to just contain test cases covering policy loading.
Moved them into test_api_v1.py and removed some redundant overlap.
:thumbsup:
I would rather keep the tests since they don't need setting up other repos and launching server processes.
Maybe just move them to greenwave/tests/test_api_v1.py?
greenwave/tests/test_api_v1.py
The end result of that will be that we have two copies of every test, one in the form of a unit test and one in the form of a functional test that makes HTTP requests. There was already a bunch of overlapping test cases that I consolidated here.
Cloning the other two git repos is a bit annoying, but it's a one-off cost. And the functional tests only take about 2-3 seconds longer than the unit tests to start up. Is it really so bad?
The problem is that new contributor has to set up two other repos to be able to run functional test. Without those tests, the test coverage is already poor and so is the confidence in making changes.
I want to test small part of code (unit test), not integration with other parts (pinpointing an issue could be difficult).
I have a bad feeling that lot of things can go wrong when spinning new processes for tests.
FWIW, I think I agree with Dan here.
It would be one thing if the new contributor had to clone the koji repo and set up koji hub with self-signed certs, and trust them, and... etc.
But here, they only have to clone two other repos. The greenwave functional tests do all the heavy lifting of setup and teardown.
I think I've been bitten by stale mocks too many times.
I'd like to merge this as is, since it cleans up some duplication which is annoying for other patches I'm working on.
If the functional tests are too slow or burdensome, let's work on ways to make them nicer, instead of just giving up on them. For example if the setup finds that you don't have a git checkout of Resultsdb, we could print a message giving the command you need to run to clone it into the right place, so that it's just a one-line copy-paste to get it running.
Pull-Request has been merged by dcallagh
Some test cases covering parts of the HTTP API had crept into
test_policies.py, which is supposed to just contain test cases covering
policy loading.
Moved them into test_api_v1.py and removed some redundant overlap.