Appsilon / rhino

Build high quality, enterprise-grade Shiny apps at speed
https://appsilon.github.io/rhino
286 stars 24 forks source link

Problem with Cypress: unable to successfully run rhino::test_e2e() #603

Open marcusyoung opened 1 month ago

marcusyoung commented 1 month ago

Steps to reproduce

  1. I am working through the Rhino Masterclass from ShinyConf 2024
  2. I have got to task 5
  3. When I run rhino::test_e2e() I get the error message shown below.
  4. I get the same error also with a new Rhino project.

Bug description

> rhino::test_e2e()

> test-e2e
> start-server-and-test run-app [http://localhost:3333](vscode-file://vscode-app/c:/Program%20Files/Positron/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#) run-cypress

1: starting server using command "npm run run-app"
and when url "[ '[http://localhost:3333](vscode-file://vscode-app/c:/Program%20Files/Positron/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#)' ]" is responding with HTTP status code 200
running tests using command "npm run run-cypress"

> run-app
> cd .. && Rscript -e "shiny::runApp(port = 3333)"

- The project is out-of-sync -- use `renv::status()` for details.
Loading required package: shiny

Listening on [http://127.0.0.1:3333](vscode-file://vscode-app/c:/Program%20Files/Positron/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#)

> run-cypress
> cypress run --project ../tests

It looks like this is your first time using Cypress: 13.6.2

[STARTED] Task without title.
[FAILED] Cypress failed to start.
[FAILED] 
[FAILED] This may be due to a missing library or dependency. [https://on.cypress.io/required-dependencies](vscode-file://vscode-app/c:/Program%20Files/Positron/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#)
[FAILED] 
[FAILED] Please refer to the error below for more details.
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] C:\Users\myoun\AppData\Local\Cypress\Cache\13.6.2\Cypress\Cypress.exe: bad option: --smoke-test
[FAILED] C:\Users\myoun\AppData\Local\Cypress\Cache\13.6.2\Cypress\Cypress.exe: bad option: --ping=795
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] Platform: win32-x64 (10.0.22631)
[FAILED] Cypress Version: 13.6.2
Cypress failed to start.

This may be due to a missing library or dependency. [https://on.cypress.io/required-dependencies](vscode-file://vscode-app/c:/Program%20Files/Positron/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#)

Please refer to the error below for more details.

----------

C:\Users\myoun\AppData\Local\Cypress\Cache\13.6.2\Cypress\Cypress.exe: bad option: --smoke-test
C:\Users\myoun\AppData\Local\Cypress\Cache\13.6.2\Cypress\Cypress.exe: bad option: --ping=795

----------

Platform: win32-x64 (10.0.22631)
Cypress Version: 13.6.2
Error: Command failed with exit code 1: npm run run-cypress
    at makeError (C:\Users\myoun\git-repos\rhino-masterclass\task5\.rhino\node_modules\execa\lib\error.js:60:11)
    at handlePromise (C:\Users\myoun\git-repos\rhino-masterclass\task5\.rhino\node_modules\execa\index.js:118:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  shortMessage: 'Command failed with exit code 1: npm run run-cypress',
  command: 'npm run run-cypress',
  escapedCommand: '"npm run run-cypress"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Error in `node_run()` at [rhino/R/node.R:15:3](vscode-file://vscode-app/c:/Program%20Files/Positron/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#):
! System command 'npm' exited with status 1.
Show Traceback
>

Expected behavior

Results of cypress test to be displayed

Rhino diagnostics

Windows 10 x64 build 22631 R version 4.4.1 (2024-06-14 ucrt) rhino: 1.7.0 node: v20.15.1

Comments

No response

marcusyoung commented 1 month ago

For information, cypress runs correctly, if npm run test-e2e is run from the .rhino directory. As does npm run test-e2e-interactive