diff --git a/nix/README.md b/nix/README.md index b96984454..33fae433d 100644 --- a/nix/README.md +++ b/nix/README.md @@ -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 diff --git a/nix/tools/tests.nix b/nix/tools/tests.nix index 9f5dc2e2b..eddeccd4d 100644 --- a/nix/tools/tests.nix +++ b/nix/tools/tests.nix @@ -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 ''