-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore: replace fast-glob with tinyglobby #6274
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
the tests seem to fail some snapshots, but only because they have a different order. should i update the snapshots or do a manual .sort? |
Why is the order different? |
unsure why until i debug a bit more, but it looks like it's alphabetically sorted now, maybe it's the opposite in fast-glob? ideally vitest should report errors in the same order regardless of the order the glob results came in. from earlier tests i did weeks ago tinyglobby's globs aren't guaranteed to be sorted. iirc globs in general follow a non-deterministic order even if fast-glob in particular doesn't |
Vitest has a built in sequencer that does sorting: https://vitest.dev/config/#sequence-sequencer |
i'm having a bit of trouble debugging due to vitest running tests using itself |
Hm, looks like we sort by names only when sharding. Normally, we use |
okay, so after debugging i can confirm that on that particular test case, fast-glob returns the two results reverse sorted, while tinyglobby does sort them correctly. should i just change the snapshots? |
ce517aa
to
cfe4efc
Compare
pushed the snapshot sorting update, i don't see why it should keep the unsorted order it had, and if anything that can always be changed in a followup pr |
What determines “correctly”? Why the previous sorting is incorrect and what are the consequences of that change? Is this flaky? Will test order be non-deterministic with tinyglobby? |
from my testing, the array of two elements produced from globbing in that test is not alphabetically sorted, and it is in tinyglobby, every single time i've ran these tests. by correct i meant it being sorted at all. despite that, i don't have evidence that globbing is deterministic with tinyglobby. the proper fix would be to just let vitest sort the reports itself |
You said it returns them in reversed order, so that's sorted, no? Just in reverse.
Tests bail out early, so if there are more errors, you won't see them unless all tests have run |
Sorry for being picky here. I just remember that the sorting is important for filtering for example and while I appreciate the smaller size and dependencies count (and I agree that we should keep making it smaller), we should keep it as compatible as possible. |
that array of two elements in particular seems to be reverse sorted, not because fast-glob returns globs reverse sorted but because an array of two can only ever be either sorted or reverse sorted :P weird wording on my part |
cfe4efc
to
0ed1bbf
Compare
it seems like the config in that test in particular breaks tinyglobby, and it'd be complex and hacky enough to add. thankfully it's the only remaining failing test it looks like a very hacky config? if the root is |
It does seem weird, but if it worked before then someone might've used this in the wild. But I haven't seen any usage of this pattern to be honest. We'll discuss with the team how we can proceed here in the next meeting. Thank you for the PR! |
after thinking a lot about the problem, it is something important to have regardless of its use in vitest. i have a not that hacky fix almost ready, but it makes using patterns with leading |
opened a fix SuperchupuDev/tinyglobby#18, will wait until you have the meeting you mentioned though |
The team thinks it's fine to drop support for |
0ed1bbf
to
c7dd95b
Compare
after refactoring out the |
c7dd95b
to
2597a19
Compare
ended up adding |
0467c52
to
43c003d
Compare
Description
tinyglobby
is meant to be a drop-in replacement toglobby
andfast-glob
, and it only uses two subdependencies -fdir
andpicomatch
. as discussed in the discord server, this PR switches to itexpandDirectories
is explicitly disabled for betterfast-glob
compatibilityfunny enough the vitest monorepo already uses it in some way, due to
unocss
andvite-plugin-pwa
using itPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.