mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2025-12-11 17:50:11 +01:00
Compare commits
2 commits
b732e118df
...
e8da91ad27
| Author | SHA1 | Date | |
|---|---|---|---|
| e8da91ad27 | |||
| 6ee3811b56 |
6 changed files with 12 additions and 5 deletions
|
|
@ -9,12 +9,16 @@
|
||||||
|
|
||||||
Flexible test runner for testing Nix code, written in Go.
|
Flexible test runner for testing Nix code, written in Go.
|
||||||
|
|
||||||
|
[](https://asciinema.org/a/VS8uIiEQiPRtXbOreJqrxO7X6)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Snapshot, Unit (equal checks) and Script-Tests (unit tests with assertions you could say)
|
- Snapshot, Unit (equal checks) and Script-Tests (unit tests with assertions you could say)
|
||||||
- Supports testing against raw Nix code or derivation output
|
- Supports testing against raw Nix code or derivation output
|
||||||
- Simple and easy to read summary of test results
|
- Simple and easy to read summary of test results
|
||||||
|

|
||||||
- Junit report support (eg. for displaying the results in GitLab etc.)
|
- Junit report support (eg. for displaying the results in GitLab etc.)
|
||||||
|

|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@
|
||||||
```sh title="nix run .#nixtests:run -- --help"
|
```sh title="nix run .#nixtests:run -- --help"
|
||||||
Usage of nixtest:
|
Usage of nixtest:
|
||||||
--junit string Path to generate JUNIT report to, leave empty to disable
|
--junit string Path to generate JUNIT report to, leave empty to disable
|
||||||
|
--no-color Disable coloring
|
||||||
--pure Unset all env vars before running script tests
|
--pure Unset all env vars before running script tests
|
||||||
--skip string Regular expression to skip (e.g., 'test-.*|.*-b')
|
-s, --skip string Regular expression to skip tests (e.g., 'test-.*|.*-b')
|
||||||
--snapshot-dir string Directory where snapshots are stored (default "./snapshots")
|
--snapshot-dir string Directory where snapshots are stored (default "./snapshots")
|
||||||
--tests string Path to JSON file containing tests
|
-f, --tests string Path to JSON file containing tests (required)
|
||||||
--update-snapshots Update all snapshots
|
-u, --update-snapshots Update all snapshots
|
||||||
--workers int Amount of tests to run in parallel (default 4)
|
-w, --workers int Amount of tests to run in parallel (default 4)
|
||||||
```
|
```
|
||||||
|
|
|
||||||
BIN
docs/images/gitlab_junit_screenshot.png
Normal file
BIN
docs/images/gitlab_junit_screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 173 KiB |
BIN
docs/images/summary_screenshot.png
Normal file
BIN
docs/images/summary_screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
|
|
@ -7,4 +7,6 @@ Flexible test runner for testing Nix code, written in Go.
|
||||||
- Snapshot, Unit (equal checks) and Script-Tests (unit tests with assertions you could say)
|
- Snapshot, Unit (equal checks) and Script-Tests (unit tests with assertions you could say)
|
||||||
- Supports testing against raw Nix code or derivation output
|
- Supports testing against raw Nix code or derivation output
|
||||||
- Simple and easy to read summary of test results
|
- Simple and easy to read summary of test results
|
||||||
|

|
||||||
- Junit report support (eg. for displaying the results in GitLab etc.)
|
- Junit report support (eg. for displaying the results in GitLab etc.)
|
||||||
|

|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ Examples:
|
||||||
name = "pretty-test";
|
name = "pretty-test";
|
||||||
# by default it uses json to serialize and compare the values. Derivations
|
# by default it uses json to serialize and compare the values. Derivations
|
||||||
# and functions don't really work that way though, so you can also use
|
# and functions don't really work that way though, so you can also use
|
||||||
# "pretty" to use lib.generators.pretty
|
# "pretty" to use lib.generators.toPretty
|
||||||
format = "pretty";
|
format = "pretty";
|
||||||
# you can also set the pos here
|
# you can also set the pos here
|
||||||
pos = __curPos;
|
pos = __curPos;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue