Skip to content
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

🛠 Help write E2E Tests! #368

Closed
15 of 16 tasks
arcanis opened this issue Aug 20, 2019 · 21 comments
Closed
15 of 16 tasks

🛠 Help write E2E Tests! #368

arcanis opened this issue Aug 20, 2019 · 21 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@arcanis
Copy link
Member

arcanis commented Aug 20, 2019

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:

  • ESLint
  • Gulp
  • Husky
  • Jest
  • Mocha
  • Parcel 2
  • Prettier
  • Rollup
  • TypeScript
  • Webpack 5

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:

  • First try to see whether it's caused by a package not depending on another. Yarn will tell you if it thinks it's the case.

  • If Yarn doesn't tell you anything but you get a "module not found" error or similar, use the PNP_DEBUG_LEVEL=1 (or 2 for all the calls, whether they succeed or not) environment variable to get more insight as to what's failing in the resolution.

  • If an error tells you that your own package is trying to require a package without listing it, and if you're sure that no, you're definitely not requiring this package, then something is probably passing an unresolved plugin name to something else (typically this could be a Webpack loader, or a Babel plugin).

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).

@arcanis arcanis added enhancement New feature or request help wanted Extra attention is needed labels Aug 20, 2019
@arcanis arcanis pinned this issue Aug 20, 2019
@arcanis arcanis added this to the 2.0.0 milestone Aug 20, 2019
@willgriffiths
Copy link
Contributor

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

@arcanis
Copy link
Member Author

arcanis commented Aug 26, 2019

I love this table 😍

image

@willgriffiths
Copy link
Contributor

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

@arcanis
Copy link
Member Author

arcanis commented Aug 27, 2019

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

@willgriffiths
Copy link
Contributor

willgriffiths commented Aug 27, 2019 via email

@eps1lon
Copy link
Member

eps1lon commented Aug 27, 2019

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
Copy link
Contributor

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
Copy link
Member Author

arcanis commented Aug 27, 2019

@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 nodejs/node#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
Copy link
Contributor

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
Copy link
Member Author

arcanis commented Aug 29, 2019

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
Copy link
Contributor

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

@arcanis
Copy link
Member Author

arcanis commented Aug 31, 2019

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
Copy link
Contributor

A little update on the webpack e2e tests.

Theres a bug in compatibility with webpack-cli and webpack 5.
webpack/webpack-cli#1023
webpack/webpack-cli#1065

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

@arcanis
Copy link
Member Author

arcanis commented Sep 5, 2019

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
Copy link
Member

eps1lon commented Sep 13, 2019

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
Copy link
Member Author

arcanis commented Sep 13, 2019

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

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

@eps1lon
Copy link
Member

eps1lon commented Sep 13, 2019

@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 👍 Monkey patched it and after some undeclared dependency errors I got it to work: eps1lon/berry-next@239a738

arcanis added a commit that referenced this issue Jan 15, 2020
* Adds an E2E test for TypeScript ESLint

**What's the problem this PR addresses?**

#368 - Adding one basic test for ESLint with `typescript-eslint`

* Moves the ESLint-TS workflow in the ESLint workflow

* Updates the workflows

* Resetup E2E for typescript-eslint integration test

Co-authored-by: Maël Nison <nison.mael@gmail.com>
@pontakornth
Copy link

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

@paul-soporan
Copy link
Member

paul-soporan commented Mar 27, 2020

@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 😄

@arcanis arcanis changed the title [Chore] Comprehensive E2E Testing 🛠 E2E Tests Apr 22, 2020
@arcanis arcanis changed the title 🛠 E2E Tests 🛠 Help write E2E Tests! Apr 22, 2020
@kylemh
Copy link

kylemh commented Jul 23, 2020

Should babel be on this list?

@arcanis arcanis unpinned this issue Sep 27, 2020
@arcanis
Copy link
Member Author

arcanis commented May 23, 2022

Closing as we now have a bunch of tests! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants