Compare commits

..

No commits in common. "e8da91ad27f4e73d22d095c8b0ca607bd50880d9" and "b732e118dfcd8b2f9b8b2302ee96ad0644f9923f" have entirely different histories.

6 changed files with 5 additions and 12 deletions

View file

@ -9,16 +9,12 @@
Flexible test runner for testing Nix code, written in Go. Flexible test runner for testing Nix code, written in Go.
[![asciicast](https://asciinema.org/a/VS8uIiEQiPRtXbOreJqrxO7X6.svg)](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
![screenshot](./docs/images/summary_screenshot.png)
- Junit report support (eg. for displaying the results in GitLab etc.) - Junit report support (eg. for displaying the results in GitLab etc.)
![screenshot](./docs/images/gitlab_junit_screenshot.png)
## Usage ## Usage

View file

@ -3,11 +3,10 @@
```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
-s, --skip string Regular expression to skip tests (e.g., 'test-.*|.*-b') --skip string Regular expression to skip (e.g., 'test-.*|.*-b')
--snapshot-dir string Directory where snapshots are stored (default "./snapshots") --snapshot-dir string Directory where snapshots are stored (default "./snapshots")
-f, --tests string Path to JSON file containing tests (required) --tests string Path to JSON file containing tests
-u, --update-snapshots Update all snapshots --update-snapshots Update all snapshots
-w, --workers int Amount of tests to run in parallel (default 4) --workers int Amount of tests to run in parallel (default 4)
``` ```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

View file

@ -7,6 +7,4 @@ 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
![screenshot](./images/summary_screenshot.png)
- Junit report support (eg. for displaying the results in GitLab etc.) - Junit report support (eg. for displaying the results in GitLab etc.)
![screenshot](./images/gitlab_junit_screenshot.png)

View file

@ -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.toPretty # "pretty" to use lib.generators.pretty
format = "pretty"; format = "pretty";
# you can also set the pos here # you can also set the pos here
pos = __curPos; pos = __curPos;