Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit dd128f6

Browse files
committed
doc: re-running tests
1 parent dca7f56 commit dd128f6

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/adding-tests.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,33 @@ These are super easy: simply add `.sql` files to the
1313
[tests/smoke](./../tests/smoke/) directory, then:
1414

1515
```
16-
nix flake check
16+
nix flake check -L
1717
```
1818

19+
(`-L` prints logs to stderrr, for more details see `man nix`)
20+
1921
These files are run using `pg_prove`; they pretty much behave exactly like how
2022
you expect; you can read
2123
[the pgTAP documentation](https://pgtap.org/documentation.html) for more.
2224

2325
For a good example of a pgTAP test as a pull request, check out
2426
[pull request #4](https://github.com/supabase/nix-postgres/pull/4/files).
2527

28+
## Re-running tests
29+
30+
`nix flake check` gets its results cached, so if you do it again the tests won't rerun. If you change a file then it will run again.
31+
32+
If you want to force rerun without modifying a file, you can do:
33+
34+
```
35+
nix build .#checks.x86_64-linux.psql_14 --rebuild
36+
nix build .#checks.x86_64-linux.psql_15 --rebuild
37+
```
38+
39+
Limitation: currently there's no way to rerun all the tests, so you have to specify the check attribute.
40+
41+
To get the correct attribute (`#checks.x86_64-linux.psql_15` above), you can do `nix flake show`. This will show a tree with all the output attributes.
42+
2643
## Migration tests
2744

2845
> **NOTE**: Currently, migration tests _do not happen in CI_. They can only be

0 commit comments

Comments
 (0)