denoland / std

The Deno Standard Library
https://jsr.io/@std
MIT License
3.23k stars 621 forks source link

experiment: BYO test coverage explorer #5982

Open iuioiua opened 2 months ago

iuioiua commented 2 months ago

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):

Pilot here

kt3k commented 2 months ago

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.

iuioiua commented 2 months ago

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 {} +
kt3k commented 2 months ago

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
iuioiua commented 2 months ago

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
kt3k commented 2 months ago

Then maybe use:

find coverage -name "*.json" -delete
kt3k commented 2 months ago

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

iuioiua commented 2 months ago

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

iuioiua commented 2 months ago

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 commented 2 months ago

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

iuioiua commented 1 month ago

Ping @kt3k

BlackAsLight commented 1 month ago

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

iuioiua commented 1 month ago

Maybe deploy daily?

BlackAsLight commented 2 weeks ago

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