End-to-end tests in 200ms with Turborepo

  Рет қаралды 44,118

Vercel

Vercel

Күн бұрын

Пікірлер: 25
@siggerz100
@siggerz100 2 жыл бұрын
Been using this approach in our UI monorepo with 50 UI components and 500 WebDriverIO tests. This approach gets super powerful when combined with -filter 🎉
@yt-sh
@yt-sh 2 жыл бұрын
can we get link to your repo?
@barehandstudio
@barehandstudio 2 жыл бұрын
first time viewer and now a subscriber. i go lost in the other hlf of the video. but thanks for introducing me to Playwright Testing.
@PhiliprecordsTV
@PhiliprecordsTV 2 жыл бұрын
I see a lot of projects where the e2e tests test something with a real db or external service where there is state and complex data. the caching would here would show you a green test even when the data was changed underneath the the test should actually fail right?
@TheHouseTutorials
@TheHouseTutorials 2 жыл бұрын
I think it depends on what is inside your build, if your build stores state from external services then it would keep the tests green. But if you do something like client side fetching then tests will vary based on you external state. It's not caching the process of testing on this build it's caching the build. Let me know if I'm wrong :)
@srymisclick
@srymisclick 2 жыл бұрын
@@TheHouseTutorials that's true for his dev:test which is not cached, but the e2e:test depends on build pipeline step and is cached so the e2e tests will not be re-run until the build step produces a new artifact. So if the e2e tests depend on external data, then this workflow will not work if different external test data is expected to produce a different tests results. You could work around this by grabbing that external data and letting turbo cache it (via an npm script and making a turbo pipeline step out of it), then if code changes OR test data changes, tests cache gets invalidated and tests are re-run.
@minnow1337
@minnow1337 2 жыл бұрын
You could separate those tests which depend on an external service under a different command in your pipeline and they can either have no cache so they are always run or you can include another step which checks if the external service has the same state as when it was last ran
@rico454
@rico454 Жыл бұрын
Do you have this template repo anywhere?
@newbiegamers5471
@newbiegamers5471 Жыл бұрын
why is it my build time is become took longer time to finish? since the package/web-tests is dependent with app/web and somehow when im try to build the app it also compiling the package/web-tests node_modules. where can i see the build config?
@srymisclick
@srymisclick 2 жыл бұрын
A package that depends on an app? Isn't this upside down? Or is it tolerable just because the "package" is tests, so it's not a real package? Put it somewhere else then, maybe? Have "apps", "packages" and "something else" in turbo? So many questions.
@questionyourbeliefs
@questionyourbeliefs Жыл бұрын
I'm putting mine in tests/. So I have apps/, packages/, tests/.
@yassinebouchoucha
@yassinebouchoucha 2 жыл бұрын
your next course for Turborepo ! When ?
@kasper_573
@kasper_573 Жыл бұрын
Are there any plans to support this type of workflow and caching strategy without requiring a separate package for the test suite? It's fairly common for projects to colocate their tests with their production code, so it would be nice if turborepo could accommodate this.
@ala.garbaa
@ala.garbaa 2 жыл бұрын
Hello, You have explained very well, I've learned news concepts. Thank you. I gave you +1 like. See you soon on a new tutorial.
@jim.....
@jim..... Жыл бұрын
i understand the purpose here is to show the caching feature, but the explanation of this workflow really could do with being expanded on.
@MuratKeremOzcan
@MuratKeremOzcan 2 жыл бұрын
Uses a Cypress plugin for PW demo, hehe. You can insert any e2e framework, really. How would you approach an app that uses json-server? Serving the app and the api is easy, how would you build the app while serving the api?
@siggerz100
@siggerz100 2 жыл бұрын
Two levels of test coverage. One where you test with the real API on a staging environment for example. And another “system test” where the test application is spun up locally, and you send the API requests to a mock server, using something like Wiremock. Allowing you to mock the API endpoints/ responses in your test :)
@MuratKeremOzcan
@MuratKeremOzcan 2 жыл бұрын
@@siggerz100 right, all true How would it work in Turbo repo with the approach being shown is the curious part
@siggerz100
@siggerz100 2 жыл бұрын
@@MuratKeremOzcan typically the tests will live as part of the system under test, so I don’t think it isn’t a great example in the video how they’re separated. And I guess it depends on the monorepo. If you wanted to have everything in a monorepo. The API would live as part of its own package, and would be a dependency of the application under test, with the tests living in the SUT package. This way when you build the application, Turborepo knows to build the API too. Turbo will also know if you make changes to the API, because it’s a dependency of the SUT, that will also need to be rebuilt/tested If however the API lives in another repo, then you’ll have to do the mocking as mentioned in my last comment. And test the real API with the application once both have been deployed. Feel free to DM and I can link you an open-source repo I work on that uses Turbo + WebDriverIO. Same practices can be applied to other test frameworks though.
@BenjaminPaigesGoogle
@BenjaminPaigesGoogle Жыл бұрын
"Pooop" [me: giggles like a child]
@gustavomanolo
@gustavomanolo 2 жыл бұрын
Great video! could you share the GitHub repo for this video? Thanks in advance :)
@mehrabmahmudpur6984
@mehrabmahmudpur6984 2 жыл бұрын
Blazingly Fast
@cas818028
@cas818028 2 жыл бұрын
And here I thought you only taught typescript!
@andreaslassak2111
@andreaslassak2111 2 жыл бұрын
1 small tip from QA to solve this .. just make your e2e solution as separate app, in separate solution .. dont waste time to have it inside the app itself. welcome.
@dan61616
@dan61616 2 жыл бұрын
Not sure how this would save any time - you are suggesting creating an entirely new project just for the e2e? Sounds like it would take more time to be honest. Not to mention you don’t get any of the caching or shared until from a monorepo.
Build an AI photo restorer app with Next.js and Replicate
4:20
Александр Канунников - Почему Playwright лучше Jest, а Vitest тормозит: измеряем coverage как профи
45:28
HolyJS — конференция для JavaScript‑разработчиков
Рет қаралды 2,8 М.
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
How to structure a JS/TS monorepo | From Zero to Turbo - Part 1
11:58
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 240 М.
Build anything with v0 (3D games, interactive apps)
9:05
Vercel
Рет қаралды 142 М.
Learn Turborepo By Example | Code Sharing, Distributed Cache, & More!
1:47:05
Why use a monorepo?
6:32
Vercel
Рет қаралды 110 М.
Stop Writing So Many Tests
10:02
Web Dev Simplified
Рет қаралды 98 М.
GitHub Actions Feels Bad
26:27
fasterthanlime
Рет қаралды 99 М.