-
Notifications
You must be signed in to change notification settings - Fork 51
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
tests: local test speed optimizations, add cargo hack feature powerset #176
Conversation
Codecov Report
@@ Coverage Diff @@
## main #176 +/- ##
==========================================
- Coverage 96.69% 96.31% -0.38%
==========================================
Files 17 17
Lines 4506 4510 +4
==========================================
- Hits 4357 4344 -13
- Misses 149 166 +17
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Thanks for jumping on this, will definitely improve my life when working on webpki!
The `test_too_many_path_calls` unit test artificially inflates the budget for signature validation operations so that it can easily force quadratic path building runtime, up to the default `build_chain_calls` budget. As a result this test takes a long time relative to our other unit tests: it completes in ~3s while the entire project test suite without this test and the bettertls tests in 0.6s. This commit adjusts the test to use a lower-than-default `build_chain_calls` budget. This lets us test the mechanics of the budget are working as intended, without having to expend a lot of runtime to run up the budget to the large default.
The Netflix bettertls test suite for pathbuilding and name constraint validation take an outsized amount of runtime compared to our other tests. These tests can take ~8s locally and the entire project test suite with these tests ignored can be run in 0.6s. This commit adds an `#[ignore]` flag so it won't be run by default. We will opt-in to running this test in CI w/ `cargo test -- --ignored`.
The `better_tls` unit test in the `better_tls.rs` integration test module was named before we added the `name_constraints` unit test. This commit renames the `better_tls` unit test to `path_building` to reflect that it runs the path building testsuite from bettertls.
We ignore the bettertls path building and name constraint test suites because they take longer than the rest of the webpki test suite, bogging down local development. In the context of CI we don't mind that extra runtime (on the order of ~15..30s) so this commit updates the CI configuration to always run ignored tests alongside the rest of the test suite.
This commit updates CI to use `cargo hack` to test the feature powerset, ensuring that we can catch feature interplay related breakages early. Unlike w/ the main Rustls repo the webpki powerset is small and the test completes in <30s, so it's fair to include in the default CI instead of needing to be separated into a separate daily tests workflow.
ed573de
to
dc8f5d8
Compare
Going to merge, but as always happy to tweak further. |
Recently our unit test runtime has been bogging down. Three tests in particular were slow relative to the rest:
test_too_many_path_calls
fromverify_cert.rs
, and the path building and name constraint test suites from the bettertls based integration test. Our entire project test suite minus those three tests completes in <0.5s. Runningtest_too_many_path_calls
alone takes ~3s, and the better tls suite was ~8s.This branch does a few things to remedy this:
test_too_many_path_calls
run faster by setting a lowerbuild_chain_calls
budget.cargo hack
feature powerset test to CI.This should help keep regular development fast while still maintaining good coverage.