Test Configuration
Learn how to configure test runner behavior through project settings and command line options
Test runner provides flexible configuration options that allow you to set default test behavior in your project configuration file and override it as needed via command line flags. This approach helps maintain consistent testing practices across your project while still allowing per-run customization.
Configuration Methods
Acton supports two methods for configuring test behavior:
- Project Configuration — Set defaults in
Acton.tomlfor consistent behavior - Command Line Flags — Override configuration for specific test runs
Configuration Precedence
When both methods are used, the precedence order is:
- Command line flags (highest priority) — override everything
- Acton.toml settings (medium priority) — project defaults
- Built-in defaults (lowest priority) — fallback values
Project Configuration in Acton.toml
Basic Configuration
Add a [test] section to your Acton.toml file to configure 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"Command Line Override
Any configuration option can be overridden via 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 get fun `...wallet...`
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
When using TeamCity CI, combine teamcity with console reporter to see detailed test output 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].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"
include-wrappers = true
include-tests = trueFuzz 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 Fuzz Testing 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 |
fail-on-diff is applied when running baseline comparison mode with
--baseline-snapshot <FILE>.
Examples:
[test]
fail-on-diff = trueacton test --baseline-snapshot gas-baseline.json --fail-on-diffJUnit 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 |
fork-net | --fork-net | String | Network to fork from |
Fork Testing Options
| Configuration | CLI Flag | Type | Description |
|---|---|---|---|
fork-net | --fork-net | string | Network name to fork state from (mainnet, testnet, or 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 in the
environment when the built-in fork target needs TonCenter authentication.
Using a custom network:
[networks.my-local-node]
api = { v2 = "http://localhost:8081/api/v2/jsonRPC" }
[test]
fork-net = "my-local-node"Examples:
[test]
# Custom JUnit output directory
junit-path = "custom-reports"
junit-merge = trueLast updated on