-
Notifications
You must be signed in to change notification settings - Fork 521
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
[RunAllTests] Consolidate testing to ensure all tests are covered in Bazel CI #2697
[RunAllTests] Consolidate testing to ensure all tests are covered in Bazel CI #2697
Conversation
Introduces top-level module tests so that all tests can be included by default. Adds a bit of extra redundant processing for app module tests. Also, fixes OptionsFragmentTest which wasn't previously included. Removes unnecessary DataBinderMapperImpl per fixing #1683. This results in all tests building, but they have not yet been confirmed to be passing.
Entailed: 1. Removing non-test targets from match 2. Readding databinder mapper file (not sure why it can't be removed, but not digging into it now) 3. Fix ExceptionsControllerTest so that it works correctly when run outside of Gradle 4. Other various fixes Altogether, 17 new tests were added to the Bazel test matrix.
Forcing all tests to run in this PR to illustrate the new tests being covered. I can't rely on compute_affected_targets since there seem to be some issues with it at the moment (see #2691 (comment)). |
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.
Nit change suggested. You can resolve this comment directly.
Remove extra space.
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.
Great, this will be really helpful for the migration to make sure the tests don't break.
…re-covered Conflicts: app/BUILD.bazel app/app_test.bzl domain/domain_test.bzl testing/BUILD.bazel testing/testing_test.bzl utility/BUILD.bazel utility/utility_test.bzl
Normalize Bazel docstrings.
Updated the PR to include some reworking of Bazel doc comments to be more normalized/consistent. |
@anandwana001 PTAL--we should try to get this in soon since it's reintroducing tests that were previously missed in Bazel builds. |
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.
LGTM, missed it earlier.
This PR updates our test declarations such that all tests under each module are always included. In all, this effort has introduced 17 test targets that were previously missing.
Note that this is intentionally a stop-gap solution since we're planning to move all tests over to individual targets (at which point we will need another check in place to ensure tests are being properly added). To prepare for this work, each module BUILD file now has a MIGRATED_TESTS list that will automatically filter out migrated tests from module-level test generation.
This PR includes fixes for ExceptionsControllerTest (similar to the fixes for LogWorkerUploadTest in #1904) since stack traces differ at runtime between Gradle & Bazel. Also, this PR forces all app module tests to be resource-compatible which introduces an extra genrule for each one. This does affect the build time slightly, but it's not substantially noticeable unless large numbers of tests are being built/run at one time.