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

[CI test only] Cypress E2E Windows Runner #2227

Closed
wants to merge 8 commits into from

Conversation

thedavidprice
Copy link
Contributor

Will Cypress run on Windows?

@thedavidprice
Copy link
Contributor Author

Runner is using PowerShell as default: shell: C:\Program Files\PowerShell\7\pwsh.EXE

@thedavidprice
Copy link
Contributor Author

Setting the shell explicitly to bash seemed to be working. However, it errors when starting the dev server --> Error: The directory name is invalid. (Failed run here.)It's the same variable used successfully on the previous two steps:
Screen Shot 2021-04-06 at 5 13 52 PM

Prior steps run successfully:
Screen Shot 2021-04-06 at 5 13 44 PM

@thedavidprice
Copy link
Contributor Author

Well, I think Cypress is running correctly! I ran a test skipping the dev server start, but everything seemed to work well up until stalling out waiting for localhost:8910 Here's the run. And screenshot below:
Screen Shot 2021-04-06 at 5 30 59 PM

Comment on lines 42 to 46
- name: Start server in background
shell: bash
run: yarn rw dev &
working-directory: ${{ steps.createpath.outputs.project_path }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tobbe can you help me diagnose why this would fail on Windows bash? Actually, what would be ideal is to instead use scripts for each of these steps that work on Powershell. Possible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd try something like this:

run: |
  echo "${{ steps.createpath.outputs.project_path }}"
  cd "${{ steps.createpath.outputs.project_path }}"
  yarn rw dev &

It'll tell us

  1. Do we even get a valid path to this step?
  2. Does it look right?
  3. Does it help to start the server when standing in the directory as opposed to trying to set cwd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tobbe well, that worked. Question: what would the Powershell version of this command be (if possible)?

Next step: can I have the Cypress action run with Powershell... gonna go check some docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echo and cd are both commands PS understands. So if it's GH that does the "${{ steps.createpath.outputs.project_path }}" substitution to a proper value, it should all just work in PS as well. But if GH is doing some kind of injection of variables into the shell, and it's actually bash that does the substitution then I don't know.

@cypress
Copy link

cypress bot commented Apr 7, 2021



Test summary

1 7 0 0Flakiness 0


Run details

Project RedwoodJS Framework
Status Failed
Commit edb6d65 ℹ️
Started Apr 8, 2021 11:56 PM
Ended Apr 8, 2021 11:58 PM
Duration 01:17 💡
OS Windows 10.0.17763
Browser Chrome 89

View run in Cypress Dashboard ➡️


Failures

cypress\integration\01-tutorial\tutorial.spec.js Failed
1 The Redwood Tutorial - Golden path edition > 1. Our First Page
2 The Redwood Tutorial - Golden path edition > 2. A Second Page and a Link
3 The Redwood Tutorial - Golden path edition > 3. Layouts
4 The Redwood Tutorial - Golden path edition > 4. Getting Dynamic
5 The Redwood Tutorial - Golden path edition > 5. Cells
6 The Redwood Tutorial - Golden path edition > 6. Routing Params
7 The Redwood Tutorial - Golden path edition > 7. Everyone's Favorite Thing to Build: Forms

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@thedavidprice
Copy link
Contributor Author

@Tobbe

ok fine 😤
Screen Shot 2021-04-07 at 3 08 34 PM

@Tobbe
Copy link
Member

Tobbe commented Apr 8, 2021

@thedavidprice Now that the tests actually start running - what if you keep using bash, and then try replacing cy.exec with cy.task as I'm doing in my PR? It'd be interesting to see how far that gets us.

I did the experiment over in my PR instead. Here's the run https://github.com/redwoodjs/redwood/pull/2228/checks?check_run_id=2295726909

image

In the step before, it was on the C: drive. Now it's trying to run on the D: drive. Not sure what GH or cy is doing there really

image

@thedavidprice thedavidprice marked this pull request as draft April 10, 2021 00:05
Ops & Contributing Improvements automation moved this from In progress to Done May 27, 2021
@thedavidprice thedavidprice deleted the test-windows-ci-e2e branch July 27, 2021 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants