-
Notifications
You must be signed in to change notification settings - Fork 242
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
GitLab CI: speed up execution #5235
base: master
Are you sure you want to change the base?
Conversation
d24dede
to
ea22fbf
Compare
ea22fbf
to
c173582
Compare
c173582
to
7cd9619
Compare
a5f8553
to
95335e3
Compare
The CI passes, this is ready for review and merging; thank you! Runs almost one hour faster (!) than the previous pipeline: https://ucsc-ci.com/databiosphere/toil/-/pipelines/9396 (151 minutes) vs |
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.
I like the Gitlab changes and the parallelization.
I'm not wild about the implicit connections you get from fixtures magically supplying an argument (e.g. tmp_path
when I went to grep for it is not defined in any of the files here, but also does not appear in any import
statements, so you sort of have to just know it comes from https://docs.pytest.org/en/6.2.x/tmpdir.html). But I see why fixtures will be better for bringing in things for tests than the single setUp
/tearDown
that need to be the same for all the related tests in a class. So I can buy into moving to them.
I was worried dropping assertEqual
would lose us the feature where we can actually see the mismatching values, but it turns out pytest
will rewrite the bytecode in your assert statements (!) to make that work. (Grumble grumble what happened to "explicit is better than implicit" grumble grumble.)
I'm less keen on the move away from ToilTest
, and the idea of type-checking the test files.
I liked the principle that all our test classes extend ToilTest
. It still says on there:
toil/src/toil/test/__init__.py
Lines 57 to 59 in 2de6eea
A common base class for Toil tests. | |
Please have every test case directly or indirectly inherit this one. |
It also provides the implementation for
TOIL_TEST_TEMP
which is documented as letting you control the temp dir for Toil's tests.
If we no longer want ToilTest to be the One True Base Class for test classes, we should change that docstring that says it is, and officially drop or otherwise replace features like TOIL_TEST_TEMP
which it provides. (We probably could just drop that one; I'm not sure it's really used by anyone.)
On the type-checking, it can be informative to have the type hints in the test files, but the tradeoff between developer time and ability to catch lurking mistakes is very different in test code than in the code under test. It's less clear to me that the work of maintaining a full set of type hints in test code is worth it, since it's about as much fighting MyPy as for the code under test, but can never catch an error that would happen in a real run. (I guess it can save you test runs that will definitely fail because of type errors?) If there was a way for MyPy to look at the test code and fail it when it can show there will be a type error, but not when it's just not sure there won't be, that would probably be the appropriate level of static analysis for tests. But I don't think that's a thing we can put in the MyPy ignore file. So maybe since you've already taken the time to type hint these test files, we should just take them and hope maintaining the hints won't be too much work?
So overall I think the changes needed are:
- Drop or fix
TOIL_TEST_TEMP
. - Demote
ToilTest
from being the One True Baseclass for tests, and either deprecate it in favor of not having a base class for tests, or add a new base class for Pytest-style tests to hold whatever remaining shared code we need. - Maybe a change to the contributing docs to state that we actually do want to move the project from Unittest test cases to Pytest ones, and that if you write a new test it should look like such-and-such?
command = self.base_command + ["-v", "1.0"] | ||
def test_conformance_tests_v10(self, wdl_conformance_test_repo: Path) -> None: | ||
os.chdir(wdl_conformance_test_repo) | ||
commands = [ |
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.
This is one command, not a series of commands, right?
8716858
to
88e2c0b
Compare
so a single core is not burdened with all tests at the end
No need to run the conformance tests again in "cwl-v1.2" if we are running the badge generation
…ns, and verbosity fixed common pytest options have been moved to setup.cfg
88e2c0b
to
b1f0bcc
Compare
The entire pipeline finishes in 45 fewer minutes.
Compare job times with this PR to job times without this PR.
Changelog Entry
To be copied to the draft changelog by merger:
Reviewer Checklist
issues/XXXX-fix-the-thing
in the Toil repo, or from an external repo.camelCase
that want to be insnake_case
.docs/running/{cliOptions,cwl,wdl}.rst
Merger Checklist