Repository navigation
test: let the wallet module's Robolectric tests start (251 tests across 25 classes) - #1609
Conversation
…OFF)
251 of the wallet module's unit tests, across 25 classes, have not been
running. They fail in Robolectric's setup, before any test code runs:
java.lang.UnsatisfiedLinkError: no conscrypt_jni in java.library.path
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:28)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:58)
at AndroidTestEnvironment.setUpApplicationState(:169)
Two builds of Conscrypt define the same org.conscrypt.* classes on
_testNet3DebugUnitTestRuntimeClasspath: conscrypt-android:2.5.3, which
wallet/build.gradle pulls in for TLS 1.3 on Android <= 9, and
conscrypt-openjdk-uber:2.5.2, which Robolectric 4.15.1 brings. The
Android build wins, and it loads its native library with
System.loadLibrary("conscrypt_jni") — a .so that only exists inside an
APK. Robolectric installs Conscrypt as its security provider during
setup, so every Robolectric test in the module dies there.
Turning that step off leaves the JVM's default security provider in
place. Host unit tests make no real TLS connections, so nothing in them
depends on Conscrypt. The alternative — excluding conscrypt-android from
the unit-test runtime classpaths — keeps Conscrypt under Robolectric but
is more build logic to maintain for no test-visible gain.
:wallet:test_testNet3DebugUnitTest at 3254b0a
before: 2616 tests, 252 failed, 1 skipped
after: 2616 tests, 1 failed, 1 skipped
Every one of the 251 recovered tests passes. The remaining failure is
PlatformSyncEngineRestartTest.resume_isRearmableAcrossRepeatedStopRestartCycles,
which predates this change and is unrelated to it.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe Robolectric test configuration adds ChangesRobolectric configuration
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This host-test configuration change has no established remaining failure path or merge blocker. Pre-merge checks |
|
|
✅ Final review complete — no blockers (commit 1340bb8) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The one-line Robolectric configuration change is scoped to host-test resources and leaves production dependencies and TLS configuration unchanged. Static verification found no blocking defect, but two test comments now incorrectly describe the Conscrypt setup failure as ongoing. The supplied CI checks passed, although the existing CI task does not execute the wallet's flavored unit tests and therefore does not independently verify the reported recovery counts.
💬 1 nitpick(s)
1 finding(s) not shown inline (the lines are not part of this PR's diff)
💬 Nitpick: Remove the now-stale Conscrypt failure explanation from both test comments
wallet/test/de/schildbach/wallet/ui/payments/PaymentsReceiveAddressRequestTest.kt:82-84
The new module-wide conscryptMode=OFF configuration disables the Robolectric provider installation responsible for the missing conscrypt_jni failure. This comment and ReceiveAddressFailureVisibilityTest.kt:40-43 still say every Robolectric test currently fails for that reason, incorrectly telling contributors that fragment-level coverage remains blocked by the runner. Remove that parenthetical explanation from both comments while retaining their description of the fragment-level behaviors these tests do not cover; this does not require adding new tests.
* Robolectric/instrumented concerns (fragment-level UI behavior), so they are
* not covered here — only the state they read is.
source: glm-5.3-flash (phase1-reviewer: general)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The one-line Robolectric configuration change alters host-test security-provider setup but is straightforward, well-contained, and leaves application behavior untouched. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 100% left, weekly 87% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 38% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `wallet/test/de/schildbach/wallet/ui/payments/PaymentsReceiveAddressRequestTest.kt`:
- [NITPICK] wallet/test/de/schildbach/wallet/ui/payments/PaymentsReceiveAddressRequestTest.kt:82-84: Remove the now-stale Conscrypt failure explanation from both test comments
The new module-wide `conscryptMode=OFF` configuration disables the Robolectric provider installation responsible for the missing `conscrypt_jni` failure. This comment and `ReceiveAddressFailureVisibilityTest.kt:40-43` still say every Robolectric test currently fails for that reason, incorrectly telling contributors that fragment-level coverage remains blocked by the runner. Remove that parenthetical explanation from both comments while retaining their description of the fragment-level behaviors these tests do not cover; this does not require adding new tests.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- CI's test lane silently skips the entire :wallet module (~2,600 tests) — Outside this PR's scope: the workflow passes an empty flavor to the Fastlane test lane, which constructs testDebugUnitTest, while wallet defines only flavored variants. Neither configuration changes in this PR, and the author already explicitly documents the gap and the separate follow-up. This pre-existing test gap is not retained as an additional review finding.
- Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.
Brings in #1584, #1621 and #1609. build.gradle: the base's dppVersion 5.0.0-20261016.200955-3 block (#1621) sits right after the SDK pin; kept it whole, together with the int31 pin. The recipe pointer now names HashEngineering/dash-wallet-qa, where the 5.0.0-int31 recipe is published. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rge/master-into-kotlin-sdk-phase-1-v11.9.1 Brings in 421514a (#1609), a2394ec (#1621) and 1e5fb13 (#1584). Conflicts resolved by keeping both sides: - TopUpRepository: the constructor takes this branch's pendingPaymentVerifier and #1584's dashSdkService. - ShieldedBalanceServiceImpl: the internal constructor keeps this branch's freshFundingBlocked (the funding gate) and #1621's clock and afterCoverageRead seams. - SdkTransparentUsernameCreationTest: both sides' added tests. The funding gate is not bypassed. #1621 only shows the shielded balance in the home total, and #1584 only changes the funding amount (the protocol-gated contested fee). The gate still runs before every fresh SDK funding build: the transparent username creation, the L1 invite and the shielded balance's shield from the wallet. No new spend call comes in.
One line in
wallet/test/robolectric.properties. It makes 251 unit tests across 25 classes start — they have never run.What is broken
Every Robolectric test in
:walletfails in setup, before any test code runs:Two builds of Conscrypt define the same
org.conscrypt.*classes on_testNet3DebugUnitTestRuntimeClasspath:org.conscrypt:conscrypt-android:2.5.3wallet/build.gradle(TLS 1.3 on Android ≤ 9)System.loadLibrary("conscrypt_jni")— a.sothat only exists inside an APKorg.conscrypt:conscrypt-openjdk-uber:2.5.2org.robolectric:robolectric:4.15.1libconscrypt_openjdk_jni-linux-x86_64.sofrom its jar; works on a desktop JVMThe Android build wins, and Robolectric installs Conscrypt as its security provider during setup, so it is the Android loader that runs. This is a classpath conflict in the module, not a property of any one machine.
What this changes
conscryptMode=OFFleaves the JVM's default security provider in place under Robolectric. Host unit tests make no real TLS connections, so nothing in them depends on Conscrypt.The alternative — excluding
conscrypt-androidfrom the unit-test runtime classpaths — keeps Conscrypt installed under Robolectric, but it is more build logic to maintain for no test-visible gain. The app's own classpath is untouched either way: this file applies to host unit tests only.Result
Every one of the 251 recovered tests passes. Nothing to triage. The 25 classes include the SDK cutover, tx-store, asset-lock, display-cache and send-path suites.
The one remaining failure is
PlatformSyncEngineRestartTest.resume_isRearmableAcrossRepeatedStopRestartCycles, which fails identically without this change. It is not fixed here.Two things this does NOT do
1. CI still does not run these tests.
.github/workflows/dashwallet.ymlrunsfastlane test flavor:"" type:"debug", and the lane (fastlane/Fastfile:171-175) turns that intogradle testDebugUnitTestfrom the root project.:wallethas only flavored variants (_testNet3Debug,prodDebug,stagingDebug,devnetDebug), so it has notestDebugUnitTesttask and Gradle skips the module. A green build coverscommon,crowdnode,coinbase,uphold,mayaandexploredash— about 2,600 wallet tests are not among them.Switching CI to
:wallet:test_testNet3DebugUnitTestis the obvious follow-up, but it would be red on day one because of the test below, so it belongs in its own change.2. It does not fix that test. For whoever picks it up: the test does
stopSdkEngines(); resume()three times in a tight loop and asserts threestartIfEnabled()calls; it sees three stops and two starts.resume()→kickSdkEngines()launches a job thatbindJob.join()s before starting the engine, andstopSdkEngines()cancelsstartupKickJob. A kick cancelled by the next stop is the designed behaviour; the test assumes it is not cancellable. That reading comes from the code, not from a fix — it has not been verified by changing anything.How this was found
QA of the dashj→SDK cutover. Review of #1605 asked to see
SdkTxidHeightsQueryTestrun; it could not, which is how the conflict surfaced. With this line it passes 2/2.🤖 Generated with Claude Code
Summary by CodeRabbit