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

upgrade cypress config file to v10 #833

Closed
duncdrum opened this issue Jun 17, 2022 · 4 comments · Fixed by #841
Closed

upgrade cypress config file to v10 #833

duncdrum opened this issue Jun 17, 2022 · 4 comments · Fixed by #841
Assignees
Labels
bug CI / Testing Issues related to CI and testing setup released

Comments

@duncdrum
Copy link
Collaborator

@duncdrum I'm embarrassed to show up with more of the same issues, but I am still unable to complete CI successfully. My latest experiment involved creating a completely new repo using Yeoman and pushing it to https://github.com/djbpitt/tmp (I deleted the old repo that was using that name before I began, so there is no old code at that location). I did not write any tests or otherwise configure the test harness; I just followed the prompts to create the new Yeoman project and then pushed it to GitHub. When I click on the little "x" next to the commit number at the top, I see that three checks were cancelled and one failed. I didn't cancel anything myself; so the cancelled ones were apparently cancelled automatically as a consequence of the failing one. The unit test that is created when I let Yeoman initialize a new repo passed, and it looks as if the error arose in the integration testing. I think the report is publicly accessible (that is, I think you can see the same thing I can if you click on the "x"), but just in case, here is what I think is the relevant part:

Run npm run cypress
> [email protected] cypress /home/runner/work/tmp/tmp
> cypress run
It looks like this is your first time using Cypress: 10.1.0
[STARTED] Task without title.
[SUCCESS] Task without title.
Opening Cypress...
[2540:0617/003016.501[8](https://github.com/djbpitt/tmp/runs/6928414740?check_suite_focus=true#step:13:9)81:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[2540:0617/003016.505728:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
There is a cypress.json file at the path: /home/runner/work/tmp/tmp
Cypress version [10](https://github.com/djbpitt/tmp/runs/6928414740?check_suite_focus=true#step:13:11).0.0 no longer supports cypress.json.
Please run cypress open to launch the migration tool to migrate to cypress.config.{js,ts,mjs,cjs}.
https://on.cypress.io/migration-guide
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] cypress: `cypress run`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] cypress script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-06-[17](https://github.com/djbpitt/tmp/runs/6928414740?check_suite_focus=true#step:13:18)T00_30_17_256Z-debug.log
Error: Process completed with exit code 1.

My usual assumption when Something Doesn't Work is that the cause is (my) user error, but I don't think I did anything here except respond to the Yeoman prompts. I didn't write any of my own tests. In case it's helpful, the process I followed to build is described at https://github.com/Pittsburgh-NEH-Institute/pr-app/blob/main/pr-app-tutorials/yeoman.md. As previously, I choose the "empty" option.

Originally posted by @djbpitt in #800 (comment)

@duncdrum
Copy link
Collaborator Author

@djbpitt this is not a user error. The generator is still producing a v9 cypress config file. The important line in the log is here:

Please run cypress open to launch the migration tool to migrate to cypress.config.{js,ts,mjs,cjs}.
https://on.cypress.io/migration-guide

if you follow that link or run cypress open it ll guide you through the migration. I ll cur a new release with an updated template file soon.

@duncdrum duncdrum added bug CI / Testing Issues related to CI and testing setup labels Jun 17, 2022
@duncdrum duncdrum self-assigned this Jun 17, 2022
@djbpitt
Copy link

djbpitt commented Jun 17, 2022

@duncdrum Thanks for the quick response. Running cypress (MacOS 12.4 Monetery) raises a command not found error and I don't understand any of the instructions at the linked site. It looks as if the instructions there were written for developers who are familiar with cypress, and with node in general, but as comfortable as I like to think I am with eXist-db, I have no experience with or understanding of cypress or node in general.

It sounds as if once you've issued the new release that you mention above that will fix the issue for new projects, but I have an old project that I need to repair and I don't know how to do that. If I create a new project with Yeoman after you issue a new release, will it be enough if I then update the version numbers in package.json in my old repo by copying those from the new one? That is, will the updated dependencies get installed on the next run if package.json lists version numbers higher than the ones installed when Yeoman first created the project? Or do I have to install new versions of the dependencies manually? If so, I don't know how to do that; I've been relying on Yeoman to create the framework, and I don't have the expertise to hand-edit node dependencies. Is it even possible for me to rescue my old project given that I am not an experienced node developer?

@duncdrum
Copy link
Collaborator Author

duncdrum commented Jun 17, 2022

@djbpitt you can simple manual specify "cypress": "^9.6.1" in the package.json of the generated app and be on your way. I can't say yet how the update will look like when you run the generator again, as I need to try that out myself. Chances are that there will be two config files one cypress.json (old) and one new cypress.config.js. Cypress will probably run fine with that, but removing the old file will likely have to be done by hand.

duncdrum added a commit that referenced this issue Jul 5, 2022
BREAKING CHANGE: update config files for cypress 10

presence of old config file will result in broken testsuites

close #833
close #800
duncdrum added a commit that referenced this issue Jul 5, 2022
make yo@4 explicit

see #833
@github-actions
Copy link

github-actions bot commented Jul 5, 2022

🎉 This issue has been resolved in version 8.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CI / Testing Issues related to CI and testing setup released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants