deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

experiment: BYO test coverage explorer

Open iuioiua opened this issue 1 year ago • 12 comments

We want to experiment with having a "BYO test coverage explorer" by serving deno coverage --html output instead of using Codecov. To start the experiment, we need to create a Deno Deploy project. Initial experiments show this is what's required (must be done by admin account):

  • Project name: std-test-cov
  • Repo: denoland/deno
  • Install step: deno task test
  • Build step: deno coverage --html
  • Root directory: coverage/html
  • Production branch: main
  • Entrypoint: https://deno.land/std/http/file_server.ts

Pilot here

iuioiua avatar Sep 16 '24 02:09 iuioiua

Do we commit the coverage report files in the repository? I'd prefer to avoid it as it feels like the noise to the commit history.

kt3k avatar Sep 17 '24 05:09 kt3k

Is there a way to specify where deno coverage --html output is written? If not, we should add one.

Otherwise, to remove everything from /coverage except /coverage/html, we'd have to use a complicated command like:

find /coverage -mindepth 1 -maxdepth 1 ! -name 'html' -exec rm -rf {} +

iuioiua avatar Sep 18 '24 06:09 iuioiua

Is there a way to specify where deno coverage --html output is written? If not, we should add one.

There seems none

Otherwise, to remove everything from /coverage except /coverage/html, we'd have to use a complicated command like:

find /coverage -mindepth 1 -maxdepth 1 ! -name 'html' -exec rm -rf {} +

All raw coverage data are in the form of <uuid>.json. This can be simplified to

rm coverage/*.json

kt3k avatar Sep 18 '24 07:09 kt3k

All raw coverage data are in the form of <uuid>.json. This can be simplified to

rm coverage/*.json

I get the following on my machine:

zsh: argument list too long: rm

iuioiua avatar Sep 18 '24 07:09 iuioiua

Then maybe use:

find coverage -name "*.json" -delete

kt3k avatar Sep 18 '24 08:09 kt3k

BTW I'm now not in favor of this move if we try to commit the coverage report to the repository. They will be huge noise. It duplicates the entire std source code embedded in html

kt3k avatar Sep 18 '24 08:09 kt3k

This won't commit the coverage report to the repo.

iuioiua avatar Sep 18 '24 22:09 iuioiua

It seems that files outside of coverage/html aren't uploaded to Deploy. The assets uploaded are roughly equal to the amount of files contained within coverage/html. I think this is thanks to how Deploy handles the root directory.

iuioiua avatar Sep 18 '24 23:09 iuioiua

In other words, deleting the JSON files may not be needed.

iuioiua avatar Sep 18 '24 23:09 iuioiua

Ping @kt3k

iuioiua avatar Oct 02 '24 08:10 iuioiua

To keep the commit history clean, why not have a separate branch where a GitHub action auto updates it?

BlackAsLight avatar Oct 02 '24 08:10 BlackAsLight

Maybe deploy daily?

iuioiua avatar Oct 03 '24 01:10 iuioiua

An alternative option would be to use GitHub Pages and publish with GitHub Actions. Wouldn't even need to commit to the repo and it could update with every push to the main branch

BlackAsLight avatar Nov 16 '24 23:11 BlackAsLight