Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

experiment: BYO test coverage explorer #5982

Open
iuioiua opened this issue Sep 16, 2024 · 12 comments
Open

experiment: BYO test coverage explorer #5982

iuioiua opened this issue Sep 16, 2024 · 12 comments
Assignees

Comments

@iuioiua
Copy link
Contributor

iuioiua commented Sep 16, 2024

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

@kt3k
Copy link
Member

kt3k commented Sep 17, 2024

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
Copy link
Contributor Author

iuioiua commented Sep 18, 2024

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
Copy link
Member

kt3k commented Sep 18, 2024

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
Copy link
Contributor Author

iuioiua commented Sep 18, 2024

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
Copy link
Member

kt3k commented Sep 18, 2024

Then maybe use:

find coverage -name "*.json" -delete

@kt3k
Copy link
Member

kt3k commented Sep 18, 2024

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
Copy link
Contributor Author

iuioiua commented Sep 18, 2024

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

@iuioiua
Copy link
Contributor Author

iuioiua commented Sep 18, 2024

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
Copy link
Contributor Author

iuioiua commented Sep 18, 2024

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

@iuioiua
Copy link
Contributor Author

iuioiua commented Oct 2, 2024

Ping @kt3k

@BlackAsLight
Copy link
Contributor

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

@iuioiua
Copy link
Contributor Author

iuioiua commented Oct 3, 2024

Maybe deploy daily?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants