acton test
Reference manual for the acton test command
Synopsis
acton test [options] [path]
Description
Discover and execute tests from .test.tolk files.
The test runner supports filtering, multiple reporters, coverage collection, gas snapshots, mutation testing, trace export, remote-state fork mode, and a browser UI for exploring results.
Options
Discovery Options
Test file or directory to run.
Acton discovers tests from the resolved project root.
Filter tests by regular expression.
Exclude test files or directories matching a glob pattern.
May be passed multiple times.
Include only test files or directories matching a glob pattern.
May be passed multiple times.
Execution Options
Stop after the first failing test.
[test].fail-fast, or false when it is not configured.
Seed for reproducible fuzz runs.
Enable executor debug logs at verbosity level 1.
Currently only level 1 is supported. Pass --verbose at most once.
Use this for low-level executor output such as debug.dumpStack(). For richer
debug output, use --backtrace full or --debug.
Debugging Options
Enable debug mode.
This also raises executor verbosity to collect full source locations and stack context for live stepping.
Debug server port.
Enable execution backtraces.
Currently supported value: full.
Full backtraces also raise executor verbosity to collect source locations and
call stacks without opening the debugger.
Coverage Options
Generate a coverage profile.
Coverage also raises internal executor verbosity enough to map executed locations back to source files and lines, but it does not enable stepping or print backtraces by itself.
Coverage output format.
lcov, text
Output file for the coverage report.
Fail when the final coverage score is below this percentage.
0 to 100.
--ui.
Include files from the @wrappers mapping in coverage reports.
Include .test.tolk files in coverage reports.
Profiling Options
Write gas usage statistics to a JSON snapshot file.
Compare gas usage with a baseline snapshot.
Exit non-zero when the current run differs from the baseline snapshot.
Requires --baseline-snapshot.
Reporting Options
Report format list.
console, teamcity, junit, dot
Show decoded message bodies in printed transaction trees when ABI is known.
Output directory for JUnit XML reports.
[test].junit-path, or test-results when it is not configured.
Merge all test suites into a single JUnit XML file.
Open test results in a browser UI.
Port for the browser UI server.
[test].ui-port, or 12344 when it is not configured.
Cache Options
Clear the compilation cache before running tests.
false.
Remote Options
Fork remote blockchain state for account resolution.
Historical block sequence number to fork from.
Tracing Options
Save transaction traces to a directory.
If passed without a value, Acton uses build/traces.
Acton writes one <test-name>_trace.json file per executed test and stores
shared contract metadata under contracts/<contract-name>.json.
These filenames are derived only from the test name and contract name, so
duplicate names overwrite earlier artifacts in the same output directory.
Relative paths are resolved from the project root.
TonCenter API Keys
When tests fork from the built-in mainnet/testnet backends, authenticated
requests read TONCENTER_MAINNET_API_KEY or TONCENTER_TESTNET_API_KEY.
When tests fork from custom:<name>, Acton reads <NORMALIZED_NAME>_API_KEY.
Custom network names are uppercased and non-alphanumeric characters are
replaced with _, so custom:mock-remote becomes MOCK_REMOTE_API_KEY.
Acton loads .env automatically, so the simplest setup during project work is
usually to keep these keys there and use shell environment variables only for
one-off overrides or CI.
Mutation Testing Options
Run tests in mutation testing mode.
Contract name to mutate during mutation testing.
Limit mutation testing to changed lines in the selected diff scope.
Accepted values: worktree, ref, branch.
worktreecompares the current worktree withHEADand includes untracked filesrefcompares against the explicit ref passed with--mutation-diff-refbranchcompares against the merge-base with the current branch upstream, or against--mutation-diff-refwhen provided
Base ref used by diff-based mutation testing modes.
Required with --mutation-diff ref. Optional with --mutation-diff branch.
Use it with branch when the current branch has no upstream or when you want a
different comparison base such as origin/main.
Run only selected mutation levels.
Accepted values: critical, major, minor.
Useful for faster local runs such as critical,major.
Load custom query-based mutation rules from a JSON file.
Custom rules are merged with built-in rules. If a custom rule uses the same rule ID, it overrides the built-in one. Relative paths are resolved from the project root.
Use a specific mutation session ID for progress logging and resume.
Acton writes append-only JSON Lines progress to
build/mutation-sessions/<ID>.jsonl. Re-run with the same session ID and the
same mutation filters to continue an unfinished session.
If you stop the run with Ctrl+C, Acton prints a resume command that includes
the same session ID.
Override the number of mutation workers.
By default, Acton uses the host's available parallelism. Each worker keeps its own isolated mutation workspace and reuses it across multiple mutants.
Run only specific mutation IDs from a previous mutation report.
Pass the mutation number shown in the report, and use the same mutation filters
such as --mutation-diff, --mutation-levels, and --mutation-disable-rules as the
original run. May be passed multiple times or as a comma-separated list.
Fail if mutation score is below this percentage.
0..=100.
Disable a specific mutation rule.
May be passed multiple times.
Display Options
Control when to use colored output.
auto, always, never
Project Options
Path to the Acton.toml file to use for this invocation.
Use this when running the command outside the project directory or when the manifest lives at a non-default location.
Path to the project root to use for configuration discovery and relative defaults.
This conflicts with --manifest-path.
Discovery
Acton discovers tests by finding files that end with .test.tolk.
- If
_path_is omitted, discovery starts at the resolved project root - If
_path_is a directory, search is recursive - Relative
_path_values are resolved from the current working directory
Reporting And Artifacts
--reporteron the CLI overrides[test].reporterfor the current run--uiadds the browser UI in addition to text reporters--coverage --uiadds aCoveragetab to the browser UI for browsing coverage summaries, files, and annotated source--junit-pathmatters when the JUnit reporter is enabled; it defaults to[test].junit-path, ortest-resultswhen it is not configured- executor debug logs are hidden by default; re-run with
--verbosewhen you need level-1 executor output such asdebug.dumpStack() --verboseis only low-level executor logging;--coveragealso collects source-location data, while--backtrace fulland--debugcollect richer location and stack data--coverage-filematters only with--coverage; without an explicit path, Acton writeslcov.infoforlcovandcoverage.txtfortext- coverage summaries show line and branch columns plus a blended
Score - LCOV export includes
BRDA,BRF, andBRHrecords when branch sites were observed for a file --coverage-minimum-percentchecks the final blendedScoreshown in the summary, not just% Lines- coverage excludes files under
tests/,.test.tolkfiles, and@wrapperssources by default; use--coverage-include-testsor--coverage-include-wrappersto opt in --save-test-tracewithout a value writes traces tobuild/traces- each executed test produces its own
<test-name>_trace.jsonartifact - exported bundles also include
contracts/<contract-name>.jsonfiles with code, source maps, and ABI metadata reused across tests in the same bundle - trace chains default to names like
Trace 1; usetxs.giveName("...")when you want stable human-readable names in exported artifacts and the Test UI - when you split execution with
testing.createTraceIterationCursor(), exported traces still merge batches that belong to the same logical root transaction chain --uialso enables the default trace bundle directory when--save-test-traceis otherwise absent- gas snapshot files are written only to the explicit paths passed to
--snapshotor--baseline-snapshot [test.fuzz]applies only to parameterized tests that explicitly opt in with@test.fuzz,@test.fuzz(<runs>), or@test.fuzz({ ... })--fuzz-seedoverrides[test.fuzz].seedfor the current run- fuzz tests show the seed in console output; if
[test.fuzz].seedis omitted, Acton picks a new seed for eachacton testrun
Dot Reporter
Use dot when you want compact progress output but still need full failure
diagnostics at the end of the run:
acton test --reporter dotThe progress line uses one character per test:
·passedxfailed○skipped□todo
When a test fails, the dot reporter prints the same important diagnostics as the
console reporter after the progress line: assertion diffs, transaction trees,
get-method errors, fuzz seed and input values, stdout/stderr, and source
locations. With --backtrace full, runtime failures also include backtrace
frames:
acton test --reporter dot --backtrace fullIf coverage is enabled, dot failure details are printed before the coverage summary so the failing test remains visible near the progress output.
Configuration
Defaults can be configured in Acton.toml:
[test]
reporter = ["console"]
filter = ".*jetton.*"
junit-path = "reports"
junit-merge = false
[test.fuzz]
runs = 512
max-test-rejects = 4096
seed = 42
[test.coverage]
enabled = true
# valid range: 0..=100
minimum-percent = 85
include-tests = true
include-wrappers = true
[test.mutation]
diff = "branch"
diff-ref = "origin/main"
mutation-levels = ["critical", "major"]
minimum-percent = 85
disable-rules = ["replace_plus_with_minus"]CLI flags override config values for the current invocation.
Notes
- If both
--snapshotand--baseline-snapshotare provided, Acton runs in comparison mode and does not overwrite the snapshot file --fail-on-diffrequires--baseline-snapshot- The UI and trace export features are useful for debugging failing tests and inspecting transaction trees
- You can combine
--coverageand--uito inspect the current run's coverage directly in the browser UI --coverage-minimum-percentand[test.coverage].minimum-percentare ignored when--uiis enabled--fork-netkeeps execution local while resolving blockchain state remotely--mutation-diff worktreeis intended for uncommitted local changes--mutation-diff refrequires--mutation-diff-ref--mutation-diff branchuses the upstream branch merge-base by default--mutation-rules-fileloads custom query-based rules from JSON and custom rules override built-in rules with the same ID--mutation-session-idwrites append-only JSONL progress tobuild/mutation-sessions/<ID>.jsonl--mutation-workersdefaults to the host's available parallelism; each worker reuses its own isolated mutation workspace- pressing
Ctrl+Cduring mutation testing stops the run without finalizing the session and prints a resume command for the same session ID --mutation-idexpects mutation numbers from a previous run with the same mutation filters and session selection- mutation scores in filtered runs only cover the selected mutants
--mutation-minimum-percentand[test.mutation].minimum-percentapply to that filtered mutation score after compile errors are excluded
Exit Status
0: All selected tests passed, or a non-mutating reporting mode completed successfully.1: At least one test failed, profiling drift was detected with--fail-on-diff, line coverage was below the configured minimum in non-UI coverage mode, mutation score was below the configured minimum in mutation mode, no tests matched after filtering, or infrastructure such as compilation, trace export, UI startup, or remote-state resolution failed.
Examples
-
Run all tests:
acton test -
Filter tests by name:
acton test --filter "wallet.*" -
Show executor debug logs from
debug.*helpers:acton test --verbose --filter "debug.*" -
Generate coverage and JUnit output:
acton test --coverage --coverage-format lcov --reporter junit --junit-path test-results -
Fail the run when line coverage drops below 85%:
acton test --coverage --coverage-minimum-percent 85 -
Compare gas usage against a baseline:
acton test --baseline-snapshot build/gas-baseline.json --fail-on-diff -
Run mutation testing for one contract:
acton test --mutate --mutate-contract Wallet -
Run mutation testing only for changed lines in the current worktree:
acton test --mutate --mutate-contract Wallet --mutation-diff worktree -
Run mutation testing for selected levels on the current branch:
acton test --mutate --mutate-contract Wallet --mutation-diff branch --mutation-levels critical,major -
Re-run one specific mutant from a previous report:
acton test --mutate --mutate-contract Wallet --mutation-id 2- Resume an unfinished mutation session:
acton test --mutate --mutate-contract Wallet --mutation-session-id wallet-pr-42 --mutation-diff worktree- Fail the run when mutation score drops below 85%:
acton test --mutate --mutate-contract Wallet --mutation-minimum-percent 85- Limit mutation testing to four workers:
acton test --mutate --mutate-contract Wallet --mutation-workers 4- Debug a forked-state failure with traces and the UI:
acton test tests/wallet.test.tolk --fork-net testnet --fork-block-number 55000000 --save-test-trace --ui- Enforce a gas baseline in CI:
acton test --baseline-snapshot build/gas-baseline.json --fail-on-diff --reporter console,junitSee Also
acton help wrapper- Test runner guide
Last updated on