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

Converge melos usage and CI scripts & add code coverage #2136

Merged
merged 29 commits into from
Mar 19, 2024

Conversation

kuhnroyal
Copy link
Member

@kuhnroyal kuhnroyal commented Mar 13, 2024

The idea of this PR is to make it easier to run tests locally based on melos while also adding code coverage reporting.

  • move all scripts to melos and make them available for usage locally
  • automatically generation coverage information for all Dart tests (vm, chrome, firefox)
  • print coverage results to CLI for stable SDK
  • only run analyze/format/publish on Stable SDK, this way we can skip the patching for format/analyze for older SDK versions which actually makes no sense since it is not being released

I want to further extend the coverage reporting by using https://github.com/clearlyip/code-coverage-report-action.
This action would run for each push/merge to the main branch an generate a constant coverage baseline for the main branch. The baseline is uploaded as workflow artifact and as such available to pull request which can then display the change in coverage.

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

* move all scripts to melos and make them available for usage locally
* automatically generation coverage information for all Dart tests (vm, chrome, firefox)
* print coverage results to CLI for stable SDK
@kuhnroyal kuhnroyal self-assigned this Mar 13, 2024
@kuhnroyal kuhnroyal marked this pull request as ready for review March 13, 2024 16:19
@kuhnroyal kuhnroyal requested a review from a team as a code owner March 13, 2024 16:19
@kuhnroyal
Copy link
Member Author

There are currently random test timeouts due to network/httpbun but I think this is good to go.
There is already a job summary for the stable matrix job which displays the coverage.
More information for coverage diffs will hopefully be available once the workflow on the main branch runs.

@kuhnroyal kuhnroyal force-pushed the infra/melos-scripts branch from 3bbb4a2 to 3fa6c9a Compare March 15, 2024 00:20
@kuhnroyal
Copy link
Member Author

@cfug-dev Looking for feedback on this change. I have a follow-up which moves most of the tests to a local httpun docker container in CI, which is based on this.

@AlexV525
Copy link
Member

This look fantastic and those scripts become elegant! Two more things might be added to the README too:

  1. How do contributors run tests and what matrixs should they verify locally?
  2. The current coverage of each packages.

.github/workflows/coverage_base.yml Outdated Show resolved Hide resolved
.github/workflows/coverage_base.yml Outdated Show resolved Hide resolved
scripts/melos_packages.dart Outdated Show resolved Hide resolved
@kuhnroyal
Copy link
Member Author

Added individual melos scripts for firefox/chrome and renamed test:dart to test:vm.

@kuhnroyal
Copy link
Member Author

I added a CONTRIBUTING file with some basic guidelines and the help of Copilot.

@kuhnroyal
Copy link
Member Author

I don't want to add anything about coverage yet, maybe when it has settled and is working as expected in PRs.

@AlexV525
Copy link
Member

I added a CONTRIBUTING file with some basic guidelines and the help of Copilot.

Could we also have a Chinese version? The library is widely used in the Chinese community. Adding the translation within the same file or make a separate file both look good to me.

@kuhnroyal
Copy link
Member Author

Would you mind adding a CONTRIBUTING-ZH.md file?

@AlexV525
Copy link
Member

Would you mind adding a CONTRIBUTING-ZH.md file?

That would be nice too.

@AlexV525
Copy link
Member

This should also address #2136.

@kuhnroyal
Copy link
Member Author

Can you write/translate that file or should I just ask ChatGPT? :D

@AlexV525
Copy link
Member

Can you write/translate that file or should I just ask ChatGPT? :D

Yeah please go ahead and let GPT helps

@kuhnroyal
Copy link
Member Author

This should also address #2136.

That is this PR :)

Add a Chinese version, can you check?

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@kuhnroyal kuhnroyal added this pull request to the merge queue Mar 19, 2024
Merged via the queue into cfug:main with commit d020224 Mar 19, 2024
1 of 3 checks passed
@kuhnroyal kuhnroyal deleted the infra/melos-scripts branch March 19, 2024 00:48
@AlexV525
Copy link
Member

This should also address #2136.

That is this PR :)

Ah, pasted the wrong number. It should be #1988

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

Successfully merging this pull request may close these issues.

2 participants