-
Notifications
You must be signed in to change notification settings - Fork 21
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 migration #3076
Vitest migration #3076
Conversation
QA Summary
Test CoverageCoverage report for `packages/client`Coverage report for `packages/server`
Pusher: @TylerHendrickson, Action: |
Terraform Summary
Hint: If "Terraform Format & Style" failed, run OutputValidation Output
Plan Summary
Pusher: @TylerHendrickson, Action: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good; marking this as "Request changes" so that the CI trigger modification is reverted. Once that happens, I'll bypass the main
branch requirement and merge the PR.
.github/workflows/ci.yml
Outdated
pull_request_target: {} | ||
# pull_request_target: {} | ||
pull_request: {} # TEST TRIGGER - DO NOT MERGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a comment here that will be made outdated by reverting ff47a47
@jeffsmohan Responding to your points on the main PR comment:
Agree that performance arguments don't seem compelling here – GHA is spending all of 12 seconds running these tests and <1 second generating the coverage report, which doesn't feel too egregious. FWIW, I don't think that the client- and server-side coverage tools need to be the same, but I would like to retain the ability to include a coverage report in a
I'm not certain I'm following here – are you just saying that this PR increases coverage in files where it was previously lacking? Or would you mind elaborating a bit?
Agree with your preference, and yes, I think that having more code that's explicit/obvious and less magical is especially useful for our codebases.
There can be weird implications for doing this in Python with good reason to avoid, but colocated tests are generally my preference. Are there any caveats we should be aware of / reasons why having tests organized in a mirrored directory structure (as they are today) would be beneficial? If not, I think it's worth changing (in a separate PR). |
…anch" This reverts commit ff47a47.
Scratch that, the coverage reports come out the same. I was looking at a report from before I had tweaked some settings.
Yeah, I think it's worth following language conventions when we don't have a good reason not to. For JS, it's well supported and most common to colocate the tests next to the code files. I'm not aware of any real downsides. I'll work up a follow-up PR to relocate the code. |
@TylerHendrickson thanks for the review! Responded to comments, reverted the workflow testing commit, and this should be ready to go. |
Ticket #
Description
This PR migrates our current client-side test runner/assertions/mocking (based on
vue-cli
,mocha
,chai
,sinon
) over tovitest
(https://vitest.dev/). This supports our upcoming migration fromvue-cli
over tovite
as our development server and production build utility. (See Decision #0008 for background.)This PR is meant to be easiest to review commit by commit. The key changes are:
sinon
usage, a few minor fixes)nyc
config,babel
config, packages no longer used)describe
,expect
,it
, etc.) to explicit importsI also want to specifically call out a few design considerations that might be worthy of more discussion:
Note that the coverage report itself is slightly different than it was. (Notably, some files that I think we'd want coverage for are not included in the previous reports.) If continuity in our coverage stats is important, I can try to chase down the differences and reconcile them, but my assumption is the coverage data is right now just providing helpful comments on PRs.After fixing a setting, this is no longer the case. The coverage reports match exactly.describe
,expect
,it
, etc.) to explicit imports in our tests. I have a strong preference personally for explicit, since it makes code clearer and less magic-seeming for new developers. (And the minor downside of writing slightly more code should be minimized by your editor's automation.) That said, it's a meaningful change, so I wanted to check in on it.Foo.vue
andFoo.spec.vue
would live in the same folder.) My personal conviction here isn't strong enough to warrant changing the status quo in this PR, but the argument is that colocated tests are easier to find, easier to work on, and perhaps make it easier for devs to write more tests.Screenshots / Demo Video
Testing
Automated and Unit Tests
Manual tests for Reviewer
Checklist