Skip to main content

Testing

The app​

tools/check.sh # the full gate
cd app && flutter test # unit and widget tests only

tools/check.sh runs, in order:

  1. tools/version.sh check: every version number agrees with app/pubspec.yaml.
  2. tools/lepic.sh build linux: LEPIC at the pin.
  3. dart run bin/core_check.dart: the wallet core under plain Dart, with no Flutter.
  4. flutter analyze.
  5. flutter test.
  6. The integration tests simple_test and history_test on Linux, under xvfb-run.
  7. The web build (tool/build_web.sh).

Source tools/env.sh first. The integration tests need xvfb-run.

Single tests and variants​

cd app
flutter test test/amount_test.dart
flutter test --dart-define=WFE_TOR=false test/tor_build_test.dart
xvfb-run -a flutter test -d linux integration_test/simple_test.dart

Run integration tests one file per command. Tor-specific tests are skipped in a build without Tor; run a set both ways when you touch Tor code. For the switch, see Build variants.

Screenshot tours​

app/tool/screenshot_tour_test.dart renders a tour of the screens. It is a test file, run with flutter test tool/screenshot_tour_test.dart; --dart-define=TOUR_LOCALE=de picks a language.

LEPIC​

cargo xtask check

Run it from a git checkout, with network access the first time (it fetches the dependencies of the conformance/ and fuzz/ lockfiles). It runs, and stops at the first failure:

  1. cargo fmt --all --check
  2. cargo clippy over the workspace, warnings denied, and again for lepic-ffi without default features (the build without Tor)
  3. cargo test --workspace --locked
  4. cargo deny check
  5. deps-check: crate edges and banned crates against the architecture
  6. ci-lint: workflow pins and permissions
  7. repo-lint: workspace lints, unsafe code, the bridge fingerprint, interop images
  8. the lockfile checks
  9. vectors verify

Each gate also runs alone, for example cargo xtask vectors verify or cargo xtask repo-lint.

Golden vectors​

Slates, keys, signatures and Epicbox messages are checked byte for byte against data generated by the pinned reference code. cargo xtask vectors verify checks the stored vectors; cargo xtask vectors generate [--area <area>] regenerates them and belongs to the conformance/ workspace.

Conformance​

conformance/ is a workspace of its own. It builds the reference node and wallet, which need CMake, clang, libclang, OpenSSL headers and pkg-config, so they never enter LEPIC's dependency graph.

cd conformance
cargo test --locked

Interop suite​

interop/run.sh # build, start a clean stack, run every scenario, tear it down
interop/run.sh --keep # leave the stack running
interop/run.sh --no-build # reuse the binaries already built

It runs LEPIC against an unmodified node, epic-wallet and Epicbox relay on a private Docker network with a local test chain. It needs Docker with Compose 2.17 or newer, git, jq, bash and python3. The first run compiles the reference programs from source. It exits 0 only when every scenario passed. See interop/README.md in the LEPIC repository.

Fuzzing​

cargo xtask fuzz --smoke # every target for a short run
cargo xtask fuzz --smoke --target tx_decode
cargo xtask fuzz --build # build the targets only
cargo xtask fuzz --full # a long run of every target

Fuzzing uses a pinned nightly Rust and cargo-fuzz. --jobs <n> runs several targets at once.

Upstream drift​

cargo xtask upstream-drift

Lists commits in the reference node and wallet that touched code LEPIC ports, since the commits recorded in upstream.toml. It exits with status 2 when something drifted.

The binding​

In the lepic-flutter repository:

tool/lepic.sh test # flutter test against a scripted-node library
tool/lepic.sh check # both bridge halves match the pinned LEPIC

tool/lepic.sh test builds LEPIC with a scripted node and relay (a mock build), then runs flutter test. Run on x86_64 Linux. tool/lepic.sh emulator-test [<serial>] runs the device test app on an attached Android device.

Release check​

app/tool/release_check.sh drives the real desktop wallet on Linux under xvfb, with throwaway data folders and keyring, against a live node and Epicbox relay. It moves no funds and prints no recovery phrases.

app/tool/release_check.sh pick # show the node and relay it would use
app/tool/release_check.sh desktop # run the checks in integration_test/release_check/

It needs LEPIC built for Linux and internet access. WFE_CHECK_NODE and WFE_CHECK_RELAY force a first choice of node and relay.