Skip to content

Conversation

@shai-almog
Copy link
Collaborator

Motivation

  • Provide runtime and unit test coverage for the new best-effort VPN detection APIs so API invocations are safe and behavior can be tested deterministically.
  • Make the test implementation controllable so unit tests can assert NetworkManager delegation without relying on platform networking.

Description

  • Added a Hello app smoke test VPNDetectionAPITest that calls NetworkManager.getInstance().isVPNDetectionSupported() and NetworkManager.getInstance().isVPNActive() and registered it in Cn1ssDeviceRunner.
  • Added a core unit test vpnDelegatesToImplementation() in maven/core-unittests/src/test/java/com/codename1/io/NetworkManagerTest.java that verifies NetworkManager delegates the VPN APIs to the implementation.
  • Extended TestCodenameOneImplementation with vpnDetectionSupported and vpnActive fields, a setVPNState(boolean, boolean) helper, and overrides for isVPNDetectionSupported() and isVPNActive() to allow deterministic testing.
  • Kept the platform wiring and documentation in place (Android/iOS heuristics and docs/developer-guide/io.asciidoc updates) so the APIs are implemented and documented across ports.

Testing

  • Ran core unit tests with cd maven && mvn -pl core-unittests -am -DunitTests=true -Dmaven.javadoc.skip=true -DfailIfNoTests=false -Dtest=NetworkManagerTest test, and the suite passed including the new vpnDelegatesToImplementation test.
  • Attempted to run the HelloCodenameOne module with cd scripts/hellocodenameone/common && mvn test -DskipTests=false, but it failed in this environment due to an unresolved com.codenameone:codenameone-maven-plugin:8.0-SNAPSHOT artifact (environment limitation).

Codex Task

@github-actions
Copy link

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: 18773 alert(s) (2767 errors, 6368 warnings, 9638 suggestions) (exit code 1) (report)
  • Image references: No unused images detected (report)

@github-actions
Copy link

✅ Continuous Quality Report

Test & Coverage

Static Analysis

Generated automatically by the PR CI workflow.

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 10, 2026

Compared 31 screenshots: 31 matched.

Native Android coverage

  • 📊 Line coverage: 7.21% (3659/50766 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.62% (17966/319632), branch 2.73% (848/31097), complexity 3.35% (995/29714), method 5.90% (816/13834), class 9.63% (176/1827)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 7.21% (3659/50766 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 5.62% (17966/319632), branch 2.73% (848/31097), complexity 3.35% (995/29714), method 5.90% (816/13834), class 9.63% (176/1827)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/712 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

@shai-almog
Copy link
Collaborator Author

shai-almog commented Feb 10, 2026

Compared 31 screenshots: 31 matched.
✅ Native Android screenshot tests passed.

Benchmark Results

  • VM Translation Time: 340 seconds
  • Compilation Time: 411 seconds

Detailed Performance Metrics

Metric Duration
Build Time Statistics
Setup & Unzip 31424 ms
Extract Extensions 26 ms
Google Services Setup 2 ms
Scan Classes 625 ms
Extract Libs 1172 ms
Inject Build Hints 52 ms
Generate Unit Tests 2 ms
Generate Stubs 1020 ms
Compile Stubs 2326 ms
Generate Icons 1068 ms
Prepare ParparVM 217 ms
ParparVM Execution 195613 ms
Post-VM Setup 203 ms
CocoaPods 6928 ms
Finalize 40 ms
Total Time 240720 msMaven Overhead : 100000 ms
CocoaPods Install (Script) 2000 ms
Simulator Boot 180000 ms
Simulator Boot (Run) 3000 ms
App Install 29000 ms
App Launch 84000 ms
Test Execution 233000 ms

@shai-almog shai-almog merged commit 64a339c into master Feb 10, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant