Issue #5640
closed
functional test and unit test requirements are specified in single file
Status:
CLOSED - CURRENTRELEASE
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
- Description updated (diff)
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.
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
What about moving style requirements into dev_requirements.txt and having a test_requirements.txt and func_test_requirements.txt?
daviddavis wrote:
What about moving style requirements into dev_requirements.txt and having a test_requirements.txt and func_test_requirements.txt?
+1
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.
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.
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.
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)
- 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.
- Assignee set to dkliban@redhat.com
- Sprint/Milestone set to 3.0.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Install functest_requirements.txt and unittest_requirements.txt separately
re: #5640 https://pulp.plan.io/issues/5640