Replace deprecated addSourceFile calls in AndroidTest - #1839
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. Walkthrough
Suggested reviewers: Priority: ⬇️ Low Change: Refactor Merge Risk: ⚪ Minimal · up to The Android test-source migration preserves the prior stub and fixture definitions with inline sources. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@jabrailkhalil you'll need to sign the CLA before we can review this |
… of the deprecatedcom.google.errorprone.CompilationTestHelper#addSourceFile inAndroidTest to addSourceLines with inlined Java text blocks, andremove the android testdata source files. Also drop the class-level@SuppressWarnings("deprecation") annotation, which is no longerneeded.Fixes #1425Signed-off-by: jabrailkhalil <jabrailkhalil@gmail.com>
5701389 to
e4226a2
Compare
|
Thanks @msridhar! The CLA has been signed. Ready for review whenever you have time. |
|
The CI workflows for the current head The CLA is already signed; this request concerns the separate workflow-approval gate. |
| @RunWith(JUnit4.class) | ||
| @SuppressWarnings("deprecation") | ||
| public class AndroidTest { | ||
| private static final String CORE_FRAGMENT_STUB = |
There was a problem hiding this comment.
Maybe ANDROID_APP_FRAGMENT_STUB? There is a CoreFragment class used in a test later that makes this name confusing
| } | ||
| """; | ||
|
|
||
| private static final String CORE_ACTIVITY_STUB = |
There was a problem hiding this comment.
Similarly, maybe ANDROID_APP_CORE_ACTIVITY_STUB
|
@jabrailkhalil does this really fully fix #1425? As in there are no more deprecation suppressions anywhere in tests due to that issue? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1839 +/- ##
=========================================
Coverage 87.69% 87.69%
Complexity 3450 3450
=========================================
Files 110 110
Lines 11475 11475
Branches 2355 2355
=========================================
Hits 10063 10063
Misses 652 652
Partials 760 760 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Assisted-by: Codex (GPT-6)
|
Addressed both naming comments in
I attempted the requested targeted |
@jabrailkhalil still need an answer to this question |
Fixes #1425
Replaces all remaining calls to the deprecated
CompilationTestHelper#addSourceFileinAndroidTestwithaddSourceLines, inlining the test sources as Java text blocks and deleting the android testdata source files. The now-unneeded class-level@SuppressWarnings("deprecation")is removed.Tested locally with JDK 21:
:nullaway:test --tests "com.uber.nullaway.AndroidTest"passes, andspotlessApply(ratchet from HEAD) is clean.Summary by CodeRabbit
Tests
Refactor