nix: postgrest-coverage notice

This commit is contained in:
steve-chavez
2023-08-17 13:43:48 -05:00
committed by Steve Chavez
parent 739f056b0a
commit 531a183b44
2 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -212,15 +212,14 @@ doctests for some of our modules are also available:
## Code coverage
Code coverage is available under the `postgrest-coverage` command. This will produce a `./coverage` directory that can be visualized with a simple http server.
Code coverage is available under the `postgrest-coverage` command. This will produce a `./coverage` directory that can be visualized on a browser.
```bash
# Will run all the tests and produce a coverage dir
[nix-shell]$ postgrest-coverage
...
# Visualize the output
[nix-shell]$ cd coverage
[nix-shell]$ python -mSimpleHTTPServer 8080
postgrest-coverage: To see the results, visit file://$(pwd)/coverage/check/hpc_index.html
```
## Linting and styling code
+2 -2
View File
@@ -164,7 +164,7 @@ let
${ghc}/bin/hpc markup --highlight-covered --destdir=coverage/overlay "$tmpdir"/overlay.tix || true
${ghc}/bin/hpc markup --highlight-covered --destdir=coverage/check "$tmpdir"/check.tix || true
echo "ERROR: Something is covered by both the tests and the overlay:"
echo "file://$(pwd)/coverage/check/hpc_index.html"
echo "postgrest-coverage: To see the results, visit file://$(pwd)/coverage/check/hpc_index.html"
exit 1
else
# copy the result .tix file to the coverage/ dir to make it available to postgrest-coverage-draft-overlay, too
@@ -174,7 +174,7 @@ let
# create html and stdout reports
${ghc}/bin/hpc markup --destdir=coverage coverage/postgrest.tix
echo "file://$(pwd)/coverage/hpc_index.html"
echo "postgrest-coverage: To see the results, visit file://$(pwd)/coverage/hpc_index.html"
${ghc}/bin/hpc report coverage/postgrest.tix "''${_arg_leftovers[@]}"
fi
''