-
Notifications
You must be signed in to change notification settings - Fork 1k
Windows CI Failing Tests: fix Jest test issues when run on Windows #533
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
Comments
@chrissutton Here's the overview Issue I mentioned. First off, please don't be overwhelmed with all the details or quantity of failing tests -- no expectations here for a full deep-dive. Here's the high level:
If you have experience here, we're looking for direction in the form of some "how-to" steps to fix this. We'll do the legwork if someone can point the way. But, lastly, I know Node hasn't been your focus right now, so 100% understood if this is currently a bit out of your wheelhouse. All good. |
@kimadeline I just saw from your profile you're at Microsoft (true?). If so, and your dev system is Windows, heads up that you might be running into this issue with local tests as well as the CI runner. We broke a lot of things on Windows 'cause, it turns out, we're bad at it. I would welcome any thoughts/direction/feedback from you about this if you have a chance. No pressure either way. Last note: Chris (comment above) is a good friend of mine and also at Microsoft. So no worries about stepping on toes one way or the other. All good in the name of collaboration. |
Thanks for the heads-up @thedavidprice! I do indeed work at Microsoft, but my primary dev machine is a Mac 😬 I saw that Yep I used we, we're in this CI-failure boat together ⛵ |
^^ 😆Welcome aboard! It's a little choppy at times, but there are lots of great people to make it worth the ride. (Which includes friendly banter. What we lack in TS and Window's skills, we make up for in banter... pros/cons.) re: re: And as an adjacent issue re: Windows + Paths, in some of our commands we might be potentially overcorrecting. For example, see this line in the ¯_(ツ)_/¯ That said, please know I'm providing all this primarily for context -- not expectations. Any/all help on the Windows/CI/paths front would be very helpful. But the work on the generator TS conversation/support is definitely a priority. |
Just leaving some notes here after taking a look at this issue. Maybe it will help someone else getting up to speed on this issue faster. And/or spark some ideas with someone 🙂
Following the steps above I could finally start digging in to what was actually causing the test to fail. The problem seems to be that |
Fixing the key lookup was as simple as wrapping the key in
This works because Windows actually understands both \ and / path separators, but prefers \ and so will convert the / in the string to \ Fixing that got me one step further. Next error was this:
And this is were things get ugly 🙁 My "fix" for that is:
With that hack in place all eight tests in src/commands/generate/page/tests/page.test.js passes. Any ideas how to properly fix the "Find me" path in the generated file? Or is this good enough (for now)? Could this break anything that's currently working? |
@Tobbe hack or no hack, this is fantastic. And to your question "could this break things currently working?" --> I created a specific branch for this very purpose. Could you open a PR against branch |
Will do, but I spent way over my allotted play hours on this today already 😛 Probably spent tomorrow's hours as well 😄 |
Well, I can't say enough how valuable this help is. Huge thank you! I'll keep fanning the flame here, but also loop me in for implementation help+needs as you go. |
Initial PR for just a few tests #656 |
Uh oh!
There was an error while loading. Please reload this page.
Overview
Redwood's CI has 40 failing tests on the Windows runner. This is an issue with CLI
rw generate
command's related tests and fixtures. And in most cases, the issue is due to a lack of Windows' path support.related PR #543
Current Status and Plan
The Windows CI will continue to run (and fail). However, only the Ubuntu CI runner is required to pass in order to merge a PR.Edit: Windows has been removed from CI in master. PR to re-add here #543
We would greatly appreciate any+all community help to resolve these issues and get all tests to pass on Windows! 🙏🚀
Details
For example, see the "Run tests" section of this GH Action run:
https://github.com/redwoodjs/redwood/pull/527/checks?check_run_id=661166735#step:8:1
The failing tests are all within the CLI package and related to
generate.js
tests, which are most often failing when testing paths. For Example (link to output):Prior to incorrectly assuming we had resolved these issues (100% on me 😬), Peter attempted to add support for Windows by normalizing the paths. You can view his initial work here. However, this normalization does not yet work in all cases where it was applied, nor was normalization applied to all tests.
helpers.test.js
orservice.test.js
-- there's no need to fix everything at onceThe text was updated successfully, but these errors were encountered: