test
Usage: chr test [OPTIONS]
Run tests in working directory
╭─ Configuration Properties ──────────────────────────────────────────────────╮
│ -s, --settings=SETTINGS Alternate path for project settings file │
╰─────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────╮
│ -bc, --blockchain=BLOCKCHAIN Run tests for specified blockchain(s). Can │
│ only be a single chain if used together with │
│ -m │
│ -m, --modules=MODULES Run tests in this module(s) only. Must be the│
│ part of the specified modules or its │
│ submodules. Comma delimited, will default to │
│ all modules either under each selected │
│ blockchain or test │
│ --sql-log Log sql expressions │
│ --tests= test method pattern │
│ --use-db / --no-db If a session towards the configured database │
│ should be established │
│ --test-report Generate JUnit XML test reports │
│ --test-report-dir=PATH JUnit XML test reports directory (defaults to│
│ "build/reports") │
│ --fail-on-error[=true|false] Sets test execution to stop on error and │
│ override any "failOnError" settings for tests│
│ that are in the scope being executed │
│ -ts, --timestamp Timestamp on logs │
│ -h, --help Show this message and exit │
╰─────────────────────────────────────────────────────────────────────────────╯
You can use the test command (chr test
) to run the tests specified in the test
key in the
project config file (chromia.yml
).
- Runs all the tests under the test attribute if the current working directory is where the
chromia.yml
file exists:
chr test
- Runs all the tests under the test attribute of a selected Project Settings file:
chr test --settings chromia.yml
- Runs a specific test module:
chr test --settings chromia.yml --modules test.data_test
- Runs test under test attribute for a specific blockchain:
chr test --settings chromia.yml --blockchain <blockchain name>
- Runs all the tests based on the specified text filter:
chr test --tests my_filter