Testing
The app
tools/check.sh # the full gate
cd app && flutter test # unit and widget tests only
tools/check.sh runs, in order:
tools/version.sh check: every version number agrees withapp/pubspec.yaml.tools/lepic.sh build linux: LEPIC at the pin.dart run bin/core_check.dart: the wallet core under plain Dart, with no Flutter.flutter analyze.flutter test.- The integration tests
simple_testandhistory_teston Linux, underxvfb-run. - 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:
cargo fmt --all --checkcargo clippyover the workspace, warnings denied, and again forlepic-ffiwithout default features (the build without Tor)cargo test --workspace --lockedcargo deny checkdeps-check: crate edges and banned crates against the architectureci-lint: workflow pins and permissionsrepo-lint: workspace lints, unsafe code, the bridge fingerprint, interop images- the lockfile checks
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.