Test selection#
run and collect commands have a set of flags that you can pass to change test collection.
Select suites#
You can pass --select-suites option to commands. This option defines which suites will be run/collected.
Example:
max_num_workers: 1
tests:
- suite: build
tests:
- test: setup_test
run: echo setup
- suite: run
tests:
- test: hello
run: echo hello
est-shizard run config.yml --select-suites build
In this case only tests in build suite will be run.
But you can pass regular expression to --select-suites as well. You can find regular expression rules here, and check your regular expression here
Example:
max_num_workers: 1
tests:
- suite: build
tests:
- test: setup_test
run: echo setup
- suite: run
tests:
- test: hello
run: echo hello
- suite: run_option
tests:
- test: hello_option
run: echo hello[0]
- suite: pre_run
tests:
- test: run_setup
run: echo run_setup
| Command | Suites to run |
|---|---|
est-shizard run config.yml --select-suites run |
run |
est-shizard run config.yml --select-suites 'run.*' |
run, run_option |
est-shizard run config.yml --select-suites '.*run' |
run, pre_run |
est-shizard run config.yml --select-suites '.*' |
build, run, run_option, pre_run |
Select names#
You can pass --select-names option to commands. This option defines which tests will be run.
It processes the condition in natural language, i.e. such conditions as - and, not, or and their combinations are supported.
Example:
max_num_workers: 1
tests:
- suite: build
tests:
- test: setup_test
run: echo setup
- suite: run
tests:
- test: hello
run: echo hello
| Command | tests to run |
|---|---|
est-shizard run config.yml --select-names 'setup_test' |
setup_test |
est-shizard run config.yml --select-names 'not setup_test' |
hello |
est-shizard run config.yml --select-names 'setup_test or hello' |
setup_test, hello |