-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Comparing changes
Open a pull request
base repository: vercel/turborepo
base: v1.12.1
head repository: vercel/turborepo
compare: v1.12.2
- 10 commits
- 96 files changed
- 7 contributors
Commits on Jan 31, 2024
-
Examples tests revamp. (#7098)
The tests for examples have proven to be a point of friction for us. This PR aims to fix that. ### Try it out locally with `turbo test -F "@turborepo-examples-tests*" --continue --concurrency=5` --- There is a bit of technical debt associated with these tests, I'm told. Historically, these tests were used more like integration or end-to-end tests to ensure that `turbo` was behaving predictably on example monorepos. Today, we're making the explicit commitment that **these tests no longer need to serve that goal**. Instead, they are for **ensuring that the examples work correctly against the latest published version of `turbo`**. We're making sure that users can trust that `npx create-turbo@latest [-e <some-example>]` will work out of the box. ## Problems to solve - [x] **Complexity** - It appears that our scripting once handled swapping out package managers for every example. We no longer feel the need to test our examples in this way. We trust that the rest of our CI has managed these complexities way before they make it to end users downloading an example. - There is also layers of scripting around platforms, git, and manipulating the package manager. I'm not totally sure what these were for - but they're not useful for our new goals. - [x] **Flakiness** - I suspect that we're not actually surfacing broken examples in these tests. I've received reports from users that our examples didn't work out of the box - _while these tests are green_. 🧐 As we peel back the technical debt, I believe we will find out if this is indeed the case. - I've personally experienced these tests _fail_ at unexpected times, _pass_ at unexpected times, and _pass and fail_ by re-running the same job multiple times with the same code. - Going back to our freshly stated goals, the tests catch problems way too late (when they do truly catch problems). The examples can potentially go untested against the latest published version of `turbo` indefinitely. - [x] **Testing the wrong thing** - The tests are currently set up to do snapshot testing using Prysk. However, we no longer are interested in trying to find drift in logs in these tests so we don't need this log capturing layer. - This Prysk layer also adds a heavy, third layer of task runner management between terminal command and final package.json script execution. The other two are `turbo`. - [x] **Debuggability** - Understanding and debugging the current test setup is **extremely** difficult. I have my suspicions that this also goes back to the Prysk layer as it makes logs quite hard to read. I've found it also swallows logs during the debugging process that would have been useful to see earlier. - I expect that this issue will fix itself as we address the complexity and flakiness concerns above. - [x] **Performance** - I have a hunch that these tests can just...be faster. This will likely be a tailwind of addressing the aforementioned complexity. ## Non-goals - There are a few examples that we don't test due to their own internal complexities (namely, Docker). We could choose to test these examples in the future but we're preferring to fix what we already have first. - We **do not** want to test the examples against `turbo`@`HEAD`. ## Key changes - **No more Prysk!**: My first experiment was to get Prysk out of the way to see what was going on more clearly and, well, I kept not using it and kept getting closer to my goals. - **No more snapshot tests**: Because we're not concerned about drift in the examples, we can stop doing snapshot tests. This piggybacks on the "No more Prysk" idea. - **Way less scripting**: I love Bash just as much as the next developer. But, alas, the new codepaths use way less of it. Fewer steps, less work, trimming the fat of things we used to do that we no longer need to. ## Results - [x] These updates **caught issues in the existing examples**! I'm not certain how these issues were being covered up in the previous implementation but I've confirmed three important fixes that were being hidden. They were caught in CI and I fixed them. Early win! - [x] The tests now have significantly less complexity, only doing the work that they really need to be doing. - [x] From my experimenting, the tests are now deterministic. I can quickly reproduce issues on my local machine that I found in CI. I've also had success purposefully creating errors and resolving them. - [x] They're faster. Locally testing is approximately 90% faster for me while CI is about 50% faster. This likely a symptom of being simpler. - [x] They're more predictable, more debuggable, and I've included a README to ensure continued understanding of these tests in the future. ## TODO? - [ ] We could choose to run these tests on a cron to ensure we're keeping up with published sooner. This PR still leaves us open to not testing the examples against `latest`. (This is slightly mitigated by Dependabot always running on Mondays. We would find out that `latest` broke an example then.) - [ ] We could also choose to run these tests as a part of the release process. Closes TURBO-2177 --------- Co-authored-by: Chris Olszewski <[email protected]> Co-authored-by: Mehul Kar <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 720086b - Browse repository at this point
Copy the full SHA 720086bView commit details -
release(turborepo): 1.12.1 (#7193)
Co-authored-by: Turbobot <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3b368d0 - Browse repository at this point
Copy the full SHA 3b368d0View commit details -
feat(lockfile): traverse lockfile in parallel (#7178)
### Description I remembered that the FFI interface was what was stopping me from throwing rayon at the lockfile graph traversal. This can be done easily since we already require that all lockfile implementations are `Send` and they don't mutate the underlying lockfile. There's a more elegant way to do this and avoid calculating inner closures multiple times, but this is a straightforward win. ### Testing Instructions From <img width="317" alt="Screenshot 2024-01-30 at 5 40 42 PM" src="https://github.com/vercel/turbo/assets/4131117/a6334c99-7c61-4bf3-8a24-b29999a74511"> To <img width="328" alt="Screenshot 2024-01-30 at 5 40 32 PM" src="https://github.com/vercel/turbo/assets/4131117/5c0cd0c4-1818-4468-aaac-ce47b924f385"> [serial.json](https://github.com/vercel/turbo/files/14106106/profile.json) [parallel.json](https://github.com/vercel/turbo/files/14106107/parallel.json) Closes TURBO-2197
Configuration menu - View commit details
-
Copy full SHA for 7ad704e - Browse repository at this point
Copy the full SHA 7ad704eView commit details -
perf: remove duplicate git construction (#7194)
### Description I noticed in the profile that we were calling `SCM::new` multiple times which should be avoided since this results in FS. This PR does 2 things: - Passes existing `SCM` instance around to all the places we were constructing a new instance - Kick of a thread to construct the `SCM` instance as soon as we start run, this means it will usually be ready by the time we need it. ### Testing Instructions Old profile: <img width="2321" alt="Screenshot 2024-01-31 at 9 19 56 AM" src="https://github.com/vercel/turbo/assets/4131117/bba04e6b-da2e-4051-9284-27abef6ea094"> New profile: <img width="2319" alt="Screenshot 2024-01-31 at 9 17 51 AM" src="https://github.com/vercel/turbo/assets/4131117/907a67cd-327d-4a80-914d-2f99bec81c60"> Note how we now are able to construct the `SCM` before the package graph finishes building meaning it's available for filtering the graph immediately. Closes TURBO-2206
Configuration menu - View commit details
-
Copy full SHA for 43f9e39 - Browse repository at this point
Copy the full SHA 43f9e39View commit details -
### Description Quick fix for a few clippy errors I was seeing in the repo.
Configuration menu - View commit details
-
Copy full SHA for 01de08b - Browse repository at this point
Copy the full SHA 01de08bView commit details -
fix: keep stdin open for persistent tasks (#7196)
### Description Fixes #7181 Some tools when they are connected to a TTY will take stdin being closed as a sign that they should shut down. This PR changes our behavior to keep stdin open for persistent tasks to avoid premature shutdowns. <img width="649" alt="Screenshot 2024-01-31 at 10 13 00 AM" src="https://github.com/vercel/turbo/assets/4131117/e7c26b16-2813-428b-9fe3-6eb552d2f102"> ### Testing Instructions Verify that using `vite` no longer immediately exits when invoked using a pseudoterminal. <img width="377" alt="Screenshot 2024-01-31 at 10 12 29 AM" src="https://github.com/vercel/turbo/assets/4131117/8a7f42d3-8a52-489a-9459-b6d711799512"> (`vite` outputs a clear screen sequence resulting in the run prelude being erased) Closes TURBO-2208
Configuration menu - View commit details
-
Copy full SHA for 363caf8 - Browse repository at this point
Copy the full SHA 363caf8View commit details -
### Description Add ability to use Vercel's config dir for whatever we need. Closes TURBO-2193
Configuration menu - View commit details
-
Copy full SHA for 7351651 - Browse repository at this point
Copy the full SHA 7351651View commit details -
fix(Turborepo): Handle spaces in path names in git status (#7197)
### Description - Don't stop `git status` parsing when encountering a space ### Testing Instructions - Added a unit test for `git status` testing - Added an integration test for a dry run with an added file with a space in the path name Closes TURBO-2209 --------- Co-authored-by: Greg Soltis <Greg Soltis>
Greg Soltis authoredJan 31, 2024 Configuration menu - View commit details
-
Copy full SHA for 14f5207 - Browse repository at this point
Copy the full SHA 14f5207View commit details -
feat: enable vt processing on windows (#7158)
### Description If we're on windows and are attempting to emit colors, help our users by setting [`ENABLE_VIRTUAL_TERMINAL_PROCESSING`](https://learn.microsoft.com/en-us/windows/console/setconsolemode) which allows ANSI color escape sequences to be respected by the Windows console. This might already be set to true by some users, but it is not enabled by default by Windows. ### Testing Instructions Look at the pretty colors on Windows!   (My default powershell colors are horrible and end up making the `docs:build` prefix invisible)  Closes TURBO-2186 --------- Co-authored-by: Chris Olszewski <Chris Olszewski> Co-authored-by: Mehul Kar <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cb9be59 - Browse repository at this point
Copy the full SHA cb9be59View commit details -
Configuration menu - View commit details
-
Copy full SHA for f4d6bf7 - Browse repository at this point
Copy the full SHA f4d6bf7View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.12.1...v1.12.2