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

Vitest optimizations and CI integration #4108

Merged
merged 5 commits into from Jan 24, 2022
Merged

Conversation

lukasbestle
Copy link
Member

@lukasbestle lukasbestle commented Jan 23, 2022

Describe the PR

  • Vue development mode warnings are silenced during testing
  • Test methods are imported explicitly according to the Vitest docs
  • Coverage is now collected in CI, but not submitted to Codecov yet due to the following issues:
    • .vue files are for some reason not included in the coverage report even though they are added to the list in the config. Seems to be a bug in Vitest or c8. Peeky was able to collect coverage from Vue files.
    • The covered/uncovered lines are incorrect due to a bug in Vitest (Wrong coverage report vitest-dev/vitest#375).
    • Our frontend tests are not complete enough to make coverage a valuable metric yet.

Release notes

None (Vitest is already included in 3.6.2 release notes)

Breaking changes

None

@lukasbestle lukasbestle added type: refactoring ♻️ Is about bad code; cleans up code type: tests 🧪 Is about missing tests; increases test coverage or improves tests labels Jan 23, 2022
@lukasbestle lukasbestle added this to the 3.6.2 milestone Jan 23, 2022
@lukasbestle lukasbestle self-assigned this Jan 23, 2022
@distantnative
Copy link
Member

Do the reported uncovered lines make sense for you? When I tried to setup coverage collection some days ago, I stopped cause the c8 reports actually didn't make sense (pointing to lines with just comments etc.).

@distantnative
Copy link
Member

Looks like the same problem here, e.g. panel/src/helpers/string.js is showing line 233 as uncovered. Line 233 is simply

/**

@distantnative
Copy link
Member

Potentially relates to vitest-dev/vitest#375

@lukasbestle lukasbestle marked this pull request as ready for review January 23, 2022 21:30
@lukasbestle
Copy link
Member Author

You are right, coverage support doesn't seem to be useful for us yet. I've prepared everything so we can easily switch it on when Vitest and we are ready. But for now I have disabled sending the report to Codecov from CI.

The remaining enhancements (especially the warning silencing) are still useful immediately.

@bastianallgeier bastianallgeier merged commit 1b57037 into develop Jan 24, 2022
@bastianallgeier bastianallgeier deleted the feature/vitest-ci branch January 24, 2022 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring ♻️ Is about bad code; cleans up code type: tests 🧪 Is about missing tests; increases test coverage or improves tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants