-
Notifications
You must be signed in to change notification settings - Fork 527
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
[BUG]: Certain test targets fail to execute bazel coverage commands #5481
Comments
The following incompatible files are exempted as they lack test files in the correct location. No. of files with misplaced test files: 32
(generated via the testfilecheck script) While files in the app module may still exhibit the same behavior, moving test files in other modules to their correct locations should generate appropriate coverage data. Not sure if this is the right issue to reference, but for now adding it here. |
@BenHenning, should the test files be moved to their correct locations (adding builds as needed) to enable coverage for these files - #5481 (comment)? Tried this with the test for |
Bazel Coverage
Bazel provides a way to analyze the coverage of test targets using command
or
But many targets in the oppia-android codebase seem to fail to analyze the coverage data.
Few examples of failing test targets
Few examples of passing test targets
Suspects
Few suspected reasons/findings why this occurs are:
Please look into the following issues for more history
As mentioned in the above issues
Many tests especially within the app module that are not modularized (tests that don't have their own explicit bazel target specified) seem to fail running coverages (though running bazel test succeed on the same).
Also, some of the unmodularized tests in the app module did pass eg:
SpotlightFragmentTest
.Though the SpotlightFragmentTest passes, the produced coverage.dat file does not include the SourceFile (SF:) to SpotlightFragment.kt (specified under
gen_rule
) while it includes SourceFile to SpotlightManager.kt, SpotlightShape.kt (other files in the same package specified underkt_android_library
), etc, which raises a doubt if the files that are specified under gen_rule causes issues with collecting the coverages data.Few non modularized tests when moved to its own target (modularized) do execute the coverage command with necessary SourceFile being included in the produced coverage report [comment addressing this].
Other suspects: Incorrect instrumentation filter being set, improper naming and positoning of the test files relative to their corresponding source files.
The reasons are not yet clearly identified.
The PR #5480 lists all the source files that exhibit the behaviour of failing coverage runs on its test targets and identifies the following:
Steps To Reproduce
Expected Behavior
Passing coverage analysis with log
Screenshots/Videos
No response
What device/emulator are you using?
No response
Which Android version is your device/emulator running?
No response
Which version of the Oppia Android app are you using?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: