yarnpkg / berry

πŸ“¦πŸˆ Active development trunk for Yarn βš’
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.45k stars 1.11k forks source link

πŸ›  Help write E2E Tests! #368

Closed arcanis closed 2 years ago

arcanis commented 5 years ago

Followup to #275

In order to ensure that Yarn 2 is in a good state to be released, we first need to have tests ensuring our compatibility with the ecosystem that relies on us. To this end, we will need to write end-to-end tests for the following framework / libraries. Anyone is welcome to help for any number of those tools (note that some are known working - but we want to automate this check to prevent regressions):

Frameworks:

Tools:

Methodology:

Anyone willing to lend us a hand can prepare a bash script that automatically installs one of those tools and check its behaviour somehow. Open a new issue to share it, and link it to this very issue. For example, here's a basic script that would test that Gatsby can build (we probably should expand it a bit):

# The `| cat` aims to workaround this request:
# https://github.com/gatsbyjs/gatsby/blob/99fb7b44810d658805211073ddfc18e508b57c87/packages/gatsby-cli/src/init-starter.js#L40
yarn dlx gatsby new my-gatsby | cat
cd my-gatsby
yarn build

Once done, copy one of the preexisting e2e workflows (in .github/workflows), put your testcase there, then open an PR!

If something doesn't work:

It's quite likely that some things don't work, for a reason or another. If that happens:

In any of those cases, please open a PR in the relevant repository and link it here so that we can track them. Also ping me so that I can get the discussion by mail (I likely won't answer unless needed, but it's useful to get a better idea of how fast we progress).

willgriffiths commented 5 years ago

FYI, NextJS is currently blocked by a missing dependency. @deini already made the PR. :)

arcanis commented 5 years ago

I love this table 😍

image

willgriffiths commented 5 years ago

I noticed that react-native and metro bundler are not on the list. Is that intentional? :)

arcanis commented 5 years ago

If we get someone to look at it I'd be happy to add them, I'm just sure I won't have the bandwidth to do it myself if it comes to that (I've never made RN development myself), so I don't want to make it a blocker.

Metro should already have most of the basic blocks, the problem is mainly the RN toolchain. Cf https://github.com/react-native-community/cli/issues/27

willgriffiths commented 5 years ago

Understood. I saw your message about metro support a while back and just assumed rn wasn’t far away.

I do a little rn dev and might be able to help. It makes sense to focus on these ones first, though. :thumbsup:

On Tue, 27 Aug 2019 at 4:36 pm, MaΓ«l Nison notifications@github.com wrote:

If we get someone to look at it I'd be happy to add them, I'm just sure I won't have the bandwidth to do it myself if it comes to that (I've never made RN development myself), so I don't want to make it a blocker.

Metro should already have most of the basic blocks, the problem is mainly the RN toolchain. Cf react-native-community/cli#27 https://github.com/react-native-community/cli/issues/27

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/yarnpkg/berry/issues/368?email_source=notifications&email_token=AA6EMZJ52G5WD7XSTY3HQMTQGTDNPA5CNFSM4INWZZAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5GVATA#issuecomment-525160524, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6EMZPKOR5QBX2DSMB4UTTQGTDNPANCNFSM4INWZZAA .

eps1lon commented 5 years ago

Got next working with minimal pages/config: https://github.com/eps1lon/berry-next. Working on a PR to next and then expanding the example.

willgriffiths commented 5 years ago

Parcel 2 Alpha is out but arcanis's pr didn't make it in yet. Parcel 2 e2e tests are blocked until these changes make it to the parcel alpha.

arcanis commented 5 years ago

@willgriffiths my PR was on Parcel 1, unfortunately. I made a quick experiment with Parcel 2, and on the top of my head the main problem was https://github.com/nodejs/node/issues/29117 (I haven't had time to double-check yet), which required to disable the threading backend. There also were other issues but Parcel was eating the exceptions, so I couldn't see them very well πŸ™

willgriffiths commented 5 years ago

I'm looking into writing a test for webpack 5. Are there any specific features or plugins/loaders that it would be good to test? Or if it works for one it should work for every?

There are some examples here: https://github.com/webpack/webpack/tree/master/examples

arcanis commented 5 years ago

Awesome! If possible, I'd suggest to test thread-loader, less-loader, sass-loader, and ts-loader, as they are the most likely ones to require a bit of plumbing.

I know that ts-loader requires ts-pnp at the moment, but its maintainer is super nice and would be happy to merge a PR to make it supported out of the box (just saying this to give some context; it should not be a blocker for your PR 😊).

willgriffiths commented 5 years ago

Cool. I'll have a hack and see how far I can get. :)

arcanis commented 5 years ago

Before i forget, here's the write-up about Vue's situation that @lbogdan wrote a few weeks ago:

https://gist.github.com/lbogdan/b8c652e6fd6f906492e0adf0ee044c82

willgriffiths commented 5 years ago

A little update on the webpack e2e tests.

Theres a bug in compatibility with webpack-cli and webpack 5. https://github.com/webpack/webpack-cli/issues/1023 https://github.com/webpack/webpack-cli/pull/1065

After unplugging and applying the fix in the pr it builds a basic project. Now I'm working on less-loader.

arcanis commented 5 years ago

I remember @deini mentioned a fix was needed for Next.js - they seem to have released the 9.0.6-canary.0, we should check it works with Yarn!

eps1lon commented 5 years ago

I've unchecked next since react requiring a singleton renderer for hooks to work needs either special config attention or attention within yarn. I'm just starting to look into this issue.

arcanis commented 5 years ago

@eps1lon I fixed that in Next master, but it hasn't been released yet πŸ˜ƒ

Bug: https://github.com/zeit/next.js/issues/8659 PR: https://github.com/zeit/next.js/pull/8668

eps1lon commented 5 years ago

@eps1lon I fixed that in Next master, but it hasn't been released yet

Bug: zeit/next.js#8659 PR: zeit/next.js#8668

Looks like it :+1: Monkey patched it and after some undeclared dependency errors I got it to work: https://github.com/eps1lon/berry-next/commit/239a738364e9578948909ec8243624523f36e289

pontakornth commented 4 years ago

It seem Nuxt doesn't work if the project is already initialized with npm. @nuxt/whatever is not installed.

paul-soporan commented 4 years ago

@arcanis, I apologize for accidentally editing your comment. I accidentally clicked on the Nuxt checkbox without knowing that it would edit it. I reverted my change. Now I might as well look into adding a test for Nuxt πŸ˜„

kylemh commented 4 years ago

Should babel be on this list?

arcanis commented 2 years ago

Closing as we now have a bunch of tests! ✨