Issue #5640
closedfunctional test and unit test requirements are specified in single file
Description
test_requirements.txt has requirements for unit tests, functional tests, and style tests (black).
Unit test requirements need to be installed inside containers during CI.
Functional test requirements need to be installed on the host that is running the functional tests.
Style requirements should be installed only where code style is being tested (travis host).
Right now we install test_requirements.txt on both the host and the container. The container is no longer able to install 'black' because one of the deps requires gcc. Rather than add gcc to the container we should probably break up the requirements into multiple files.
Here is an example of a failure: https://travis-ci.org/pulp/pulp_file/jobs/604662813#L1444
Updated by dkliban@redhat.com about 5 years ago
Here is a commit that demonstrates the solution: https://github.com/pulp/pulp_file/pull/302/commits/bdf00a085f22450cc008406d6f9084fdec777eec
Updated by mdellweg about 5 years ago
I am wondering whether we could make use of environment markers [0].
[0] https://www.python.org/dev/peps/pep-0508/#environment-markers
Updated by dkliban@redhat.com about 5 years ago
I don't think we can make good use of environment markers because there a limited number of them. We would want to use markers that we create. I don't think that is possible.
Updated by dkliban@redhat.com about 5 years ago
what about using the following names for files?
test_requirements.txt - contains requirements for functional tests
unittest_requirements.txt - contains requirements for unit tests
style_requirements.txt - requirements for the static analysis or style and such
Updated by daviddavis about 5 years ago
What about moving style requirements into dev_requirements.txt and having a test_requirements.txt and func_test_requirements.txt?
Updated by ipanova@redhat.com about 5 years ago
daviddavis wrote:
What about moving style requirements into dev_requirements.txt and having a test_requirements.txt and func_test_requirements.txt?
+1
Updated by gmbnomis about 5 years ago
daviddavis wrote:
What about moving style requirements into dev_requirements.txt and having a test_requirements.txt and func_test_requirements.txt?
I like that and I have one suggestion: It is possible to include requirement files in other requirement files.
We could have unittest_requirements.txt and functest_requirements.txt to make the CI happy. The usual test_requirements.txt would just include both files.
Updated by mdepaulo@redhat.com about 5 years ago
This is a very good idea IMHO. We want to install as little software as possible in the containers to minimize the risk of invalidating the containers for testing. Missing (optional) deps are often the source of bugs (as a former sysadmin, I can tell you this.)
I do think that "test_requirements.txt" should be called something like "functest_requirements.txt" (like gmbnomis said.) Otherwise, unittest_requirements.txt might be assumed to be a subset of it.
Updated by dkliban@redhat.com about 5 years ago
Requirement files cannot include other requirement files. So we should go with:
dev_requirements.txt
unittest_requirements.txt
functest_requirements.txt
I would like to move forward with making this change.
Updated by dkliban@redhat.com about 5 years ago
It was pointed out to me that you can indeed reference requirement files in a requirements file. So that means we will have:
dev_requirements.txt
unittest_requirements.txt
functest_requirements.txt
test_requirements.txt (which will simply reference the previous 2)
Added by dkliban@redhat.com about 5 years ago
Updated by dkliban@redhat.com about 5 years ago
- Status changed from NEW to MODIFIED
- Triaged changed from No to Yes
- Sprint set to Sprint 61
I've made this change in most of the repositories. The rest will receive this change when their travis config is updated next time.
Updated by dkliban@redhat.com about 5 years ago
- Assignee set to dkliban@redhat.com
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Install functest_requirements.txt and unittest_requirements.txt separately
re: #5640 https://pulp.plan.io/issues/5640