-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
test:lib
task-caching w/ Nx
#5116
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7995733:
|
Codecov ReportPatch and project coverage have no change.
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #5116 +/- ##
=======================================
Coverage 91.90% 91.90%
=======================================
Files 111 111
Lines 4188 4188
Branches 1083 1083
=======================================
Hits 3849 3849
Misses 318 318
Partials 21 21 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
love the idea of nx-cloud ❤️ |
Hey @TkDodo! Looks like this failed in CI due to some flakiness (the error comes right after a Can we give this another try? Also let me know if anything else you want to see adjusted in this branch! |
Yeah I'm trying to fix flakiness as I see it. Some tests are not written in a robust way 😅 |
That's great. If there's an effort to go after these please let me know! I think this one for example, we should use |
yeah all the newer tests are written with query/packages/react-query/src/__tests__/useQuery.test.tsx Lines 6057 to 6063 in 4aaaa51
|
Yeah I noticed that! I like that alot. Seems like there might some potential for flakiness based on this timing out, but I've actually never had a test fail on me because of that in any of the testing I've looked at for this project so far! |
Just watched your video - amazing, thank you so much for this ❤️ . I'll merge the PR and then merge it to |
please let me know if I fixed that correctly on alpha 😅 |
@ZackDeRose I can now see some post-install task failing in our pipelines: it just logs this error and it still succeeds, but the install times seem higher now (27s vs 11s before) |
okay never mind the longer times, this was just a cache miss on pnpms side. It's back to 11s with a warm cache. But do you know what the error is? |
Ah yes - the Nx Daemon is a daemon process that runs in the background to eagerly determine Nx project configuration whenever files change. Looks like the daemon stopped because of an issue parsing pnpm's lockfile. I'll bring this to our core engineers, as we should be handling this better - but the daemon failing shouldn't be considered a failing event. If it ever does fail, it should just restart itself the next time Nx would need it! |
@TkDodo - I'll be tracking this here: nrwl/nx#15656 |
Just FYI |
Thanks @JamesHenry! I'll get something up with this added now :) |
@TkDodo some quick fixes: #5128 to fix the error messages re: the nx daemon
Let's go for adding the rest of our tasks first! I think that should actually be pretty easy! I'll send you a PR soon. Let's plan for Nx cloud following that because we may have to coordinate that a bit! |
* adding quick caching test * reverting workflow change * updating pr yml to test nx speed * fixing yml on property * fixing yml on property * fixing target name * upping to running4 in parallel * upping to running 5 in parallel * upping to running 6 in parallel * upping to running 7 in parallel * upping to running 8 in parallel * upping to running 9 in parallel * upping to running 10 in parallel * opting for --parallel=5 * cleaning up nx.json * revert touching of ci.yml file * reverting on property of pr.yml file * updating root pacakge.json test:lib command * fixing frozen lockfile error in ci --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
…#4352) * feat(devtools): enable setting loading/error via devtools * Some cleanup * refactor: use flex-gap to align buttons * refactor: fix linter and dropdown reset * refactor: operate directly on activeQuery * Change buttons to toggle states * Sneak some queryState into meta * Added test for error and loading * Fix lint * Fix prettier formatting * chore: releases should run on alpha/beta as well * chore: extract package validation to an extra script (#5039) * chore: extract package validation to an extra script and run it during CI * chore: add missing `build:types` script to solid-query * docs: update link for v2 docs (#5044) * docs: update link for v2 docs * Update README.md --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v4.24.12 * fix(react-query-devtools): do not stretch query status label (#5063) Do not stretch query status label (fresh, fetching, paused, stale, inactive) shown on Query Details view. * release: v4.24.13 * fix(react-query-devtools): add 'use client' directive to disable SSR (#5041) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v4.24.14 * feat(core): re-export matchQuery from utils (#5070) Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * release: v4.25.0 * feat(query-core): Add global onSettled callbacks for QueryCache and MutationCache (#5075) * feat(query-core): Add global onSettled callbacks for QueryCache and MutationCache * test: tests for query onSettled callback * test: tests for mutation onSettled callback * docs: onSettled callbacks * release: v4.26.0 * fix(core): make sure mutations get updated options (#5085) this fixes an issue around stale closures where callbacks are not updated, thus are called with wrong values in the closure * release: v4.26.1 * fix(eslint-plugin): improve object property checks (#5079) * fix(eslint-plugin): improve object property checks * prettier * release: v4.26.2 * docs: add adapter dropdown to issue template (#5108) * docs(queries): rename `success` (#5110) * chore: `test:lib` task-caching w/ Nx (#5116) * adding quick caching test * reverting workflow change * updating pr yml to test nx speed * fixing yml on property * fixing yml on property * fixing target name * upping to running4 in parallel * upping to running 5 in parallel * upping to running 6 in parallel * upping to running 7 in parallel * upping to running 8 in parallel * upping to running 9 in parallel * upping to running 10 in parallel * opting for --parallel=5 * cleaning up nx.json * revert touching of ci.yml file * reverting on property of pr.yml file * updating root pacakge.json test:lib command * fixing frozen lockfile error in ci --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> * chore: fix missing dependencies (#5127) * chore: include scripts directory in linting and fix issues * chore: add missing dependencies chalk and semver * chore: turning off Nx daemon in CI (#5128) * chore: downgrade chalk to v4 because v5 is ESM only (#5130) see: https://stackoverflow.com/questions/70309135/chalk-error-err-require-esm-require-of-es-module * fix(eslint-plugin): ignore internal properties (#5119) * chore: resolve merge conflicts --------- Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc> Co-authored-by: Abhijeet Singh <contact.abhijeetsingh@gmail.com> Co-authored-by: Tanner Linsley <tannerlinsley@users.noreply.github.com> Co-authored-by: janinegygax <32389974+janinegygax@users.noreply.github.com> Co-authored-by: Youssouf Oumar <63708012+yousoumar@users.noreply.github.com> Co-authored-by: remolueoend <remolueoend@users.noreply.github.com> Co-authored-by: Eliya Cohen <co.eliya2@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com> Co-authored-by: Leon Fong <ooohmydawn@hotmail.com> Co-authored-by: Zachary DeRose <zack@nrwl.io> Co-authored-by: Zachary DeRose <zack.derose@gmail.com>
What This Does
test:lib
task (with Nx)test-lib
script to run with nx's run-many command, as well as theTest
workflow in.github/workflows/pr.yml
Run Test
step of theci
pipeline is adjusted as well astest:ci
will callpnpm run test:lib
Test
job of thepr
pipeline (see Task caching ZackDeRose/query#1 (comment) for my findings)test:lib:dev
commands are not affected and work exactly as they did beforeWhat this PR doesn't do, but could!
I wanted to make this PR bite-sized (as opposed to my last one!) but would be happy to expand this with more task-caching features:
nx.json
file, and some coordination to make sure I correctly understand what files are created by those tasks, and which files should/shouldn't invalidate the cache)node_modules/.cache
between ci runs via the workflow yml files, but that's much more manual process (and we'd have to eventually introduce pruning before this cache just gets too large)@TkDodo (or others!) let me know if any of the above would be appealing! I'd be happy to work on introducing any of these (either in this PR or in future PRs)
[Also note that I work full-time for Nx!]