Repository navigation
Fix #6188: Fail test file check for stale test_file_not_required exemptions - #6444
adhiamboperes merged 2 commits into
Conversation
… exemptions
A test_file_not_required exemption is only valid while the corresponding
test file is absent. When the test already exists, the exemption was
silently ignored and the check still passed, hiding exemptions that are
no longer needed.
The check now reports such exemptions as failures ('Unnecessary test
file exemptions') and the 13 currently stale exemptions are removed from
test_file_exemptions.textproto.
Adds regression tests covering the main and sharedTest test directories.
|
@jabrailkhalil this PR is being marked as draft because you are not assigned to referenced issue #6188 (or it does not exist). You may only fix issues that you are assigned to to help avoid multiple team members duplicating work on the same issue. |
|
Hi @jabrailkhalil, we require the pull requests to follow a template, otherwise the bot is going to mark it as draft. Please copy the template from here: https://github.com/oppia/oppia-android/blob/develop/.github/PULL_REQUEST_TEMPLATE.md. Also look at other recent PRs to have an idea of how folks usually fill out the PR descriptions. |
…t-file-exemptions
|
Thanks @adhiamboperes! I have updated the PR description to follow the pull request template. |
|
The current code-coverage workflow (run 34684472874, attempt 2) completed successfully, but the pull_request_target coverage-comment run 34684472168 still reflects its earlier action_required attempt and cannot find final-coverage-report. Please rerun the Comment Coverage Report workflow now that the first-time contributor run has been approved. GitHub reports that only a repository admin can do this. |
Coverage ReportResultsNumber of files assessed: 1 Passing coverageFiles with passing code coverage
|
|
Hi @jabrailkhalil, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
|
@jabrailkhalil Is this PR ready for review? If yes assign this to a reviewer by @username PTAL. Without assigning this PR it won't be reviewed. |
|
@adhiamboperes PTAL. This PR is ready for review: issue #6188 is assigned to me, the template is complete, and the coverage report passes at 99.03%. |
|
Unassigning @jabrailkhalil since a re-review was requested. @jabrailkhalil, please make sure you have addressed all review comments. Thanks! |
adhiamboperes
left a comment
There was a problem hiding this comment.
LGTM, thanks @jabrailkhalil!
|
✨ Fantastic work @jabrailkhalil! Your very first PR to Oppia has been merged! 🎉🥳 You've just taken your first step into open-source, and we couldn’t be happier to have you onboard. 🙌 For any support, feel free to reach out to the developer onboarding lead: @adhiamboperes. Happy coding! 👩💻👨💻 |
…st_file_not_required exemptions (#6561) Fixes part of #6557 This PR reverts #6444 which removed stale `test_file_not_required: true` exemptions because those files already had tests. Unexpectedly, this exposed an issue with coverage configuration: The coverage runner currently passes `--instrumentation_filter=//app/....`. This filter excludes sources built in the root `//app` package, including the four affected UI classes in #6547. Their tests pass, but Bazel doesn’t collect coverage for those classes. The reporter then fails because it cannot find their source records. Consequently: 1. Before the commit, all six files bypassed coverage analysis. 2. After it, coverage analysis started checking them. 3. That exposed the four missing source records and the two abstract modules’ 0/0 results.
Explanation
Fixes #6188: reject stale
test_file_not_requiredexemptions when the corresponding test already exists.When an existing test is marked with a
test_file_not_requiredexemption,TestFileChecksilently ignores the exemption (because the test exists) and the check still passes. Stale exemptions accumulate unnoticed and hide the fact that a test now exists.Changes
TestFileChecknow treats atest_file_not_requiredexemption as a failure when the corresponding test file already exists:Unnecessary test file exemptionsfailure section lists each stale exemption with its prod file path.The 13 currently stale
test_file_not_requiredexemptions (one per file that already has a test intest/orsharedTest/) are removed fromtest_file_exemptions.textprotoso the check passes on the current repo state.Verification
test/orsharedTest/plustest_file_not_requiredexemption now fails with the expected output; missing-test exemptions and normal test presence still pass.TEST FILE CHECK PASSED.Essential Checklist
Disclosure of LLM Usage
YesorNo.: YesWorkManagerinitialization #6062 for an example.: AI/LLMs were used for investigating the checker behavior, implementing the fix and regression tests, identifying and removing stale exemptions, running validation, and preparing the PR description.