Test configuration
Learn how to configure test runner behavior through project settings and command line options
Default test behavior is set in Acton.toml. Command-line flags override those defaults for a single run.
Configuration methods
Acton supports two methods for configuring test behavior:
- Project configuration: set defaults in
Acton.toml. - Command-line flags: override defaults for a specific run.
Configuration precedence
When both methods are used, the precedence order is:
- Command line flags (highest priority) — override matching project settings.
Acton.tomlsettings (medium priority) — project defaults.- Built-in defaults (lowest priority) — fallback values.
Project configuration in Acton.toml
Basic configuration
Add a [test] section to Acton.toml to set default test behavior:
[package]
name = "my-ton-project"
version = "0.1.0"
[test]
# Enable detailed backtraces
backtrace = "full"
[test.fuzz]
# Use 512 accepted inputs for fuzz tests marked with @test.fuzz
runs = 512
# Fix the seed for reproducible fuzz runs
seed = 42
[test.coverage]
# Enable code coverage by default
enabled = true
format = "lcov"
minimum-percent = 80Command-line overrides
Many configuration options can be overridden with command-line flags:
# Use specific reporter
acton test --reporter console
# Compact progress reporter
acton test --reporter dot
# Use multiple reporters
acton test --reporter console,junit
# TeamCity with console output
acton test --reporter console,teamcity
# Override coverage setting from config
acton test --coverage
# Override filter setting from config
acton test --filter "mint.*"
# Override reporter setting
acton test --reporter teamcity
# Multiple overrides
acton test --coverage --filter "test deploy" --debug --reporter junitConfiguration options reference
Filter options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
filter | --filter | String | Regex pattern to filter test names |
exclude | --exclude | Array | Glob patterns to exclude test files |
include | --include | Array | Glob patterns to include only test files |
Examples:
[test]
filter = ".*wallet.*" # Only tests whose names have "wallet" within
exclude = ["**/integration/**"] # Skip integration directory
include = ["**/unit/**"] # Only include unit test filesExecution options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
fail-fast | --fail-fast | Boolean | Stop executing tests after the first failure |
Examples:
[test]
fail-fast = trueReporter options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
reporter | --reporter | Array | Test output format(s) |
Supported reporters:
console— Detailed console output with code context (default)teamcity— TeamCity CI integration (minimal output, best combined with console)junit— JUnit XML reports for external toolsdot— Compact dot-style progress with detailed failure diagnostics at the end
TeamCity integration
For TeamCity CI, combine the teamcity and console reporters so detailed test output appears alongside CI integration data.
acton test --reporter console,teamcityExamples:
[test]
# Use multiple reporters
reporter = ["console", "junit"]
# Single reporter
reporter = ["teamcity"]
# Compact progress reporter
reporter = ["dot"]
# For TeamCity CI, combine with console for detailed output
reporter = ["console", "teamcity"]Debug options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
debug | --debug | Boolean | Enable debug mode |
debug-port | --debug-port | Integer | Debug server port |
backtrace | --backtrace | String | Enable stack traces ("full") |
- | --verbose | Count | Enable level-1 executor debug logs (CLI only) |
--verbose is currently binary in practice: default level 0, and level 1 when --verbose is passed once. Higher user-selected levels are not supported yet.
Examples:
[test]
debug = false
debug-port = 12345
backtrace = "full"acton test --verbose --filter "debug.*"Coverage options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
[test.coverage].enabled | --coverage | Boolean | Enable code coverage |
[test.coverage].format | --coverage-format | String | Coverage output format (lcov, text) |
[test.coverage].output-file | --coverage-file | String | Path to save the coverage report |
[test.coverage].minimum-percent | --coverage-minimum-percent | Number | Fail when the blended coverage score is below this percentage |
[test.coverage].include-wrappers | --coverage-include-wrappers | Boolean | Include files from the @wrappers mapping in coverage reports |
[test.coverage].include-tests | --coverage-include-tests | Boolean | Include .test.tolk files in coverage reports |
Examples:
[test.coverage]
enabled = true
format = "lcov"
minimum-percent = 80
include-wrappers = true
include-tests = true--coverage-minimum-percent is ignored when the run also starts Test UI with --ui.
Fuzz options
These defaults apply only to parameterized tests that explicitly opt in with @test.fuzz, @test.fuzz(<runs>), or @test.fuzz({ ... }). Per-test annotations can override them with
@test.fuzz({ runs: ..., max_test_rejects: ..., seed: ... }). When max-test-rejects is omitted, Acton uses runs * 256.
See the fuzz testing guide for annotation syntax, helper APIs, supported parameter types, and failure reporting.
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
[test.fuzz].runs | - | Integer | Number of accepted fuzz cases to execute for each fuzz test |
[test.fuzz].max-test-rejects | - | Integer | Maximum assume(...) rejections before the fuzz test fails |
[test.fuzz].seed | --fuzz-seed | Integer | Seed for reproducible fuzz input generation |
Examples:
[test.fuzz]
runs = 512
max-test-rejects = 4096
seed = 42Profiling options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
fail-on-diff | --fail-on-diff | Boolean | Exit with non-zero code when profiling differs from baseline snapshot |
gas-profile | --gas-profile | String | Path to write a gas-weighted execution profile |
gas-profile-format | --gas-profile-format | String | Gas profile output format (cpuprofile, collapsed) |
gas-profile-include-tests | --gas-profile-include-tests | Boolean | Include .test.tolk unit-test get-method execution in the profile |
fail-on-diff is applied when running baseline comparison mode with
--baseline-snapshot <FILE>.
Gas profile options apply when gas-profile or --gas-profile <FILE> is set.
Combine --gas-profile <FILE> with --ui to browse the profile as a
flamegraph in Test UI. Add --gas-profile-include-tests when the expensive
work is executed directly from .test.tolk unit-test get methods.
Examples:
[test]
fail-on-diff = true
gas-profile = "build/gas.cpuprofile"
gas-profile-format = "cpuprofile"
gas-profile-include-tests = falseacton test --baseline-snapshot gas-baseline.json --fail-on-diff
acton test --gas-profile build/gas.collapsed --gas-profile-format collapsed
acton test --gas-profile build/gas.cpuprofile --gas-profile-include-tests --uiMutation testing options
These defaults apply when the run is started with acton test --mutate --mutate-contract <NAME>.
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
[test.mutation].diff | --mutation-diff | String | Limit mutation testing to changed lines in worktree, ref, or branch scope |
[test.mutation].diff-ref | --mutation-diff-ref | String | Base ref used by ref mode and optional override for branch mode |
[test.mutation].mutation-levels | --mutation-levels | Array | Run only selected levels such as critical, major, or minor |
[test.mutation].rules-file | --mutation-rules-file | String | Path to a JSON file with custom query-based mutation rules |
[test.mutation].minimum-percent | --mutation-minimum-percent | Number | Fail when the mutation score is below this percentage |
[test.mutation].disable-rules | --mutation-disable-rules | Array | Disable selected built-in or custom mutation rules |
Examples:
[test.mutation]
diff = "branch"
diff-ref = "origin/main"
mutation-levels = ["critical", "major"]
rules-file = "mutation-rules.json"
minimum-percent = 85
disable-rules = ["replace_plus_with_minus"]JUnit options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
junit-path | --junit-path | String | JUnit XML output directory |
junit-merge | --junit-merge | Boolean | Merge all suites into one file |
Examples:
[test]
# Custom JUnit output directory
junit-path = "custom-reports"
junit-merge = trueTest UI options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
ui | --ui | Boolean | Start the browser Test UI after the run |
ui-port | --ui-port | Integer | UI server port, defaulting to 12344 |
Examples:
[test]
ui = true
ui-port = 23456Fork testing options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
fork-net | --fork-net | string | Network name to fork state from (mainnet, testnet, or custom:<name> for a custom network defined in [networks]). |
fork-block-number | --fork-block-number | integer | Specific block number to fork from. |
Examples:
[test]
fork-net = "mainnet"Use TONCENTER_TESTNET_API_KEY or TONCENTER_MAINNET_API_KEY to supply fork targets with higher RPS limits.
Using a custom network:
[networks.archive-rpc]
api = { v2 = "https://your-rpc.example/api/v2/jsonRPC" }
[test]
fork-net = "custom:archive-rpc"Last updated on