Commit Graph

14 Commits

Author SHA1 Message Date
Zoltan Papp c85852eabf ci: stream adb logcat alongside the screen recording
Save threadtime-format logcat to screen-recordings/logcat.log in the
background, in parallel with the screenrecord loop, and stop it after
the test exits. The existing screen-recordings/ artifact upload picks
it up automatically.
2026-05-10 22:23:35 +02:00
Zoltan Papp 173fd62e58 ci: fix cache path resolution and screenrecord loop race
The ${{ env.ANDROID_HOME }} expression resolves against workflow-level
env, not the runner's process environment, so the NDK and AVD system-
image cache paths came out empty-prefixed and the saves were dropped
with "Path Validation Error". Hardcode the ubuntu-latest sdk path
(/usr/local/lib/android/sdk) for both.

Also fix the screen recording: touch the sentinel file BEFORE launching
the background loop, otherwise the loop sees no file on its first
iteration and exits immediately, producing zero recordings.
2026-05-10 22:12:10 +02:00
Zoltan Papp 3692291d06 ci: cache NDK/gomobile/AVD and move test runner to a script
- setup-go: point cache-dependency-path to netbird/go.sum so the Go
  module cache actually restores (build-android-lib.sh shaves ~1-2 min).
- Cache the NDK install dir and the gomobile binary by pinned version,
  skipping the corresponding install step on cache hit.
- Cache the AVD plus the API 30 google_apis x86_64 system image, add a
  warm-up step that boots once to capture a snapshot, and run tests with
  force-avd-creation=false plus -no-snapshot-save so subsequent jobs
  load the cached snapshot without overwriting it.
- Move the screenrecord/gradle/pull pipeline to
  .github/scripts/run-instrumented-tests.sh because the emulator-runner
  action executes each line of the inline script as a separate sh -c,
  which broke the multi-line subshell loop.
2026-05-10 21:57:46 +02:00
Zoltan Papp 6c44c95df4 ci: record emulator screen during instrumented tests
Run adb screenrecord in a background loop (180s segments) for the full
duration of connectedDebugAndroidTest, then upload the segments as an
artifact. Helps diagnose UiAutomator failures that only repro in CI.
2026-05-10 21:45:58 +02:00
Zoltán Papp ff01cea884 ci: add setup-key auth instrumentation test
Adds SetupKeyAuthTest, a UiAutomator-driven instrumentation test that
drives the in-app "Change server" screen end-to-end with a setup key
and waits for the success dialog. The test taps "Use NetBird", so the
management URL is the one hard-coded in the app (Preferences.defaultServer()).
The setup key comes from an instrumentation runner argument so CI can
inject it as a secret without baking it into the APK.

Wires it into the existing build-debug workflow as a workflow_dispatch-only
job that reuses the netbird-aar artifact, so PR builds are unaffected
and the AAR is built only once per run.

Required repo config:
- Secret: INSTRUMENTATION_NB_SETUP_KEY (UUID, ideally reusable + ephemeral)
2026-05-06 12:04:59 +02:00
Zoltan Papp 7211e4d4dc ci: add workflow to bump netbird submodule on release tags (#175) 2026-04-29 17:10:37 +02:00
Zoltan Papp 029585a971 Add network connectivity stress test for VPN resilience (#162)
* Add network connectivity stress test for VPN resilience

Instrumented test that simulates real-world network disruptions (WiFi/mobile
switching, airplane mode, flapping, long outages) and verifies VPN recovery
via ping. Auto-detects real device vs emulator and uses appropriate network
control strategy for each.

* Fix review findings: resource leak, version bump, markdown lint

- Use try-with-resources in sendEmulatorConsoleCommand to prevent socket leak
- Bump testRules version from 1.6.1 to 1.7.0
- Add language specifier to fenced code block in README

* Fix review findings: restore in finally, label mismatch, readUntilOK error handling

- Always call disruption.restore in finally block to prevent stale network state
- Fix EMU latency label from 5s to 10s to match actual delay value
- Make readUntilOK propagate IOException and detect KO/EOF failures

* Exclude NetworkConnectivityStressTest from CI

This test requires a configured VPN and real network interfaces,
so it cannot run on the CI emulator. Run it manually on a real device.
2026-04-14 16:02:46 +02:00
Maycon Santos d50164314d build debug bundles when pushing to main (#107) 2025-11-25 14:19:32 +01:00
Maycon Santos 1602f54125 Update Go setup and gomobile version in Android build action (#104)
* Update Go setup and gomobile version in Android build action

* Update netbird file configuration

* update submodule
2025-11-22 11:29:54 +01:00
Diego Romar d277cf686d restart go engine on network change (#97)
* Add network change detector and listeners

* Add network toggle listener to VPNService

* Add unit tests for ConcreteNetworkChangeListener

* Rename NetworkChangeListener to NetworkAvailabilityListener

* Change EngineRunner's Set implementation

From HashSet to ConcurrentHashMap's KeySet,
which is thread-safe.

* Update submodule to the latest tag (v0.59.6)

* Add EngineRestarter to restart the Go engine

* Add LOGTAG to NetworkChangeDetector

* Add some documentation to NetworkToggleListener

* Use EngineRestarter as implementation of NetworkToggleListener

When subscribing to ConcreteNetworkAvailabilityListener

* Replace HashMap usage with ConcurrentHashMap

The availableNetworkTypes HashMap is accessed from network
callback threads without synchronization

* Wrap connectivityManager.unregisterNetworkCallback with try-catch

* Add restart runnable and timeout callback to EngineRestarter

Restart runnable is used as a debouncing mechanism to
prevent concurrent restarts
Timeout callback is to reset the isRestartInProgress flag's
value if the engine takes too long to restart

* Update git submodule reference to latest tag

* Reverse cleanup order on VPNService's onDestroy

Now it disposes of network listener components
before stopping engineRunner

* Ci tests (#99)

Add testing steps for CI

* Remove line break

---------

Co-authored-by: Zoltan Papp <zoltan.pmail@gmail.com>
2025-11-18 18:31:34 -03:00
Zoltan Papp ec68702e6e Add release CI code and bump lib version (#75) 2025-08-28 14:05:30 +02:00
Zoltan Papp f81f81ce6e rewrite client in Java (#54)
Rewrite the client in native Java.

There were no new features added in this change, but that's the first step in moving to a faster development cycle for NetBird client.
2025-06-05 20:37:51 +02:00
Zoltan Papp 0af012f40f Increase the target sdk version to 34 (#36)
If apps that target Android 14 use a foreground service, they must declare a specific permission, based on the foreground service type, that Android 14 introduces. These permissions appear in the sections labeled "permission that you must declare in your manifest file" in the intended use cases and enforcement for each foreground service type section on this page.

update compile SDK version to 34
update Go version in CI
2024-11-26 14:29:31 +01:00
Maycon Santos 304301cbf2 open-source code 2024-02-28 19:21:08 +01:00