-
Notifications
You must be signed in to change notification settings - Fork 499
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
[Feature Request]: Introduce support for code coverage & enforcement (GSoC'24 4.1) #5343
Comments
NB: This issue is locked to ensure that it only contains updates for requirements. If you have questions regarding this project, please use its corresponding discussion category: https://github.com/oppia/oppia-android/discussions/categories/gsoc-q-a-4-1-code-coverage-support. |
NB: The main issue comment has been updated to include the technical details directly rather than a link to a Gist (so that we can easily change this if needed). None of the technical requirements have actually changed. |
Milestone 1PR 1.1Introduce RunCoverage and CoverageRunner utilities to run code coverage for a specific bazel test target.
Tasks
PR 1.2Updating the test exemption script.
Tasks
PR 1.3Update / Implement script to run code coverage for a specific file replacing test target argument.
Tasks
PR 1.4Interpreting the results and building proto for data processing.
Tasks
PR 1.5Introduce CoverageReporter utility and generate the code coverage report.
Tasks
Buffer TimeTo work on reviews and code changes.
Midpoint EvaluationCode Reviews and Evaluations
Milestone 2PR 2.1Introduce new CI workflow for code coverage
Tasks
PR 2.2Upload generated markdown report as comment
Tasks
PR 2.3Fix/replace cancellation workflow
Tasks
PR 2.4Create wiki page explaining code coverage usage, limitations, file issues for coverage gaps, and test writing tips
Tasks
Buffer TimeTo work on reviews and code changes.
Final EvaluationCode Reviews and Evaluations
Spare IntervalsSpare intervals to fix any further issues.
|
Is your feature request related to a problem? Please describe.
The team cannot currently monitor and enforce minimum code coverage (as a proxy for functional behavioral coverage) in automated tests.
Describe the solution you'd like
Suggested milestones
Milestone 1: Introduce a new script to compute a per-unit code coverage percentage for a single file.
Milestone 2: Integrate code coverage checking.
Technical hints / guidance
Top-level components needed for code-coverage support
coverage.proto
: Describes the new scripting data structures needed for code coverage.CoverageRunner.kt
: A new scripting utility for running code coverage for a selected target.CoverageReporter.kt
: A new scripting utility for generating an HTML report of code coverage.RunCoverage.kt
: A new script for running code coverage locally.scripts/src/java/org/oppia/android/scripts/testfile/TestFileCheck.kt
: Existing utility that needs to be updated to include support for code coverage enforcement.scripts/src/java/org/oppia/android/scripts/proto/script_exemptions.proto
: Existing exemptions definition that needs to be updated per theTestFileCheck
changes..github/workflows/unit_tests.yml
: Existing CI workflow that needs to be updated in order to support code coverage..github/workflows/workflow_canceller.yml
: Existing CI workflow that needs to be fixed.Some key technical notes
RunCoverage.kt
script for each affected file corresponding to each affected test. For example, if StateFragmentTest.kt is one of the affected tests, then RunCoverage would be run for StateFragment.kt (which would then correspond to StateFragmentTest per its behavior).BazelClient.kt
may need to be updated to include a function for running coverage on a specific target & output the standard output lines from that (which can then be parsed to get the report to generate the CoverageReport proto object).Suggested files to add/change
coverage.proto:
CoverageReporter.kt:
CoverageRunner.kt:
RunCoverage.kt:
script_exemptions.proto:
Describe alternatives you've considered
No response
Additional context
This is the high-level tracking issue corresponding to https://github.com/oppia/oppia/wiki/Google-Summer-of-Code-2024#41-code-coverage-support-and-enforcement.
Note that this project includes work that relate to the following issues: #1497, #1726, #1727, and #1728.
The text was updated successfully, but these errors were encountered: