-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Handle Termux in InlineDelegateByteBuddyMockMaker.java #3158
Conversation
Termux on Android can run any JVM, so we cannot rely on the vendor here to determine if we are in Termux. Nonetheless, ByteBuddy can fail to instrument correctly on this platform, so it is worth showing a meaninful error message in this scenario.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3158 +/- ##
============================================
- Coverage 85.53% 85.53% -0.01%
- Complexity 2912 2914 +2
============================================
Files 333 334 +1
Lines 8856 8861 +5
Branches 1095 1096 +1
============================================
+ Hits 7575 7579 +4
Misses 993 993
- Partials 288 289 +1
☔ View full report in Codecov by Sentry. |
Is it possible to add a regression test for this? We have |
@TimvdLippe will look into it; at the very least I will add unit tests for this logic as they don't appear to exist at the moment. |
So unless I am missing something immediately obvious, I think this would be quite involved to set up a regression test for this specific case, since it'd require bundling an Android VM in the test packs (or use an external service like BrowserStack) so that Termux could be installed. Not sure if that would be worth the cost and complexity of implementing this since it would make the test pack potentially system-specific depending on how the subsystem itself would be run. I will be pushing some unit tests for this in a few minutes though, so hopefully that should improve the coverage for those condition checks and provide a set of contracts for expected/unexpected cases that could trigger this condition. |
- Implement unit tests for the ByteBuddy platform conditions - Extract the ByteBuddy platform conditions to a separate utility class to enable unit testing them separately. This also enables adding additional checks in the future without making the InlineDelegateByteBuddyMockMaker much more complicated. - Added dependency at test time for junit-jupiter-params to enable writing parameterized unit tests.
Thanks! These regression tests look good to me, thanks for adding them. |
@TimvdLippe just as an update on this... the issue with Termux has been identified. |
Termux on Android can run any JVM, so we cannot rely on the vendor here to determine if we are in Termux. Nonetheless, ByteBuddy can fail to instrument correctly on this platform, so it is worth showing a meaningful error message in this scenario.
Changes
to enable unit testing them separately. This also enables adding additional
checks in the future without making the InlineDelegateByteBuddyMockMaker
much more complicated.
parameterized unit tests.
Existing behaviour: