test(iroh-dns): APK-based smoke test for the Android JNI path#4249
Draft
Frando wants to merge 1 commit into
Draft
test(iroh-dns): APK-based smoke test for the Android JNI path#4249Frando wants to merge 1 commit into
Frando wants to merge 1 commit into
Conversation
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4249/docs/iroh/ Last updated: 2026-05-11T12:05:44Z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a follow-up to #4183. That PR gets the iroh resolver working on Android once
ndk_contextis initialized, but the workspace unit tests can't actually exercise the JNI path: they run as plain ELFs pushed viaadb shell, with no JVM in scope. On Android they either fall back to public DNS (debug builds) or would panic (release), but they never go through the realLinkProperties.getDnsServers()lookup. So the JNI code is, in practice, untested in CI.This branch adds a tiny standalone APK that does. It lives at
iroh-dns/tests/android_apk/as its own[workspace](soandroid-activityand friends do not pollute the main workspace), gets built and launched bycargo apk runfrom the existing x86_64 Android emulator CI job, and resolvesdns.iroh.linkthroughDnsResolver::new().android-activitypopulatesndk_contextfor us beforeandroid_mainruns, so the system DNS reader takes the JNI path. To prove that is what actually happened (rather than a silent fallback to public DNS) the smoke test installs ann0_tracing_testbuffer subscriber and asserts that theread system DNS via Android JNIdebug line was emitted. That is the only signal that distinguishes "JNI worked" from "JNI silently failed and we used Google".cargo apk rundoes not propagate the in-app exit code, so the test printsRESULT=okonly on full success and the CI step polls logcat for that marker. Failed assertions panic, the process aborts, and the poll loop times out.Breaking Changes
None.
Notes & open questions
Based on #4183, which adds the
debug!line this test asserts on.Change checklist