-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
When running cypress against a docker image on CI pipeline(using Codefresh) the image hangs for quite a while if using prettier-eslint cli without typescript installed on the detect Resolved typescript step #24781
Comments
Hi @dqiubread , sorry for the delay in getting to this. I'll be taking a look today and will let you know what I find |
@dqiubread , did a little research on this and have a couple questions/options. First off, I wasn't able to reproduce the "pauses for several minutes" behavior you described, but I suspect I know what's going on. While checking whether the project uses Typescript we perform a couple checks:
Based on the logs you provided (thank you for providing the debug logs, btw!) your docker image is falling through to the third condition. If your image contains a large number of files outside I do believe there is a bug here - this logic should see if a custom config file location has been specified and use that instead of assuming the config file is stored at the project root. Assuming the custom config file name/location is the problem that would mitigate this issue for you. As an aside - if your image does happen to include a large number of files do you mind sharing what sort of content it is? Is there a common sort of directories/files we should exclude beyond If I'm wrong and the config file isn't the issue here could you provide a minimal reproduction that I could use to debug? |
We do rename the cypress.config file. The image should be pretty small besides the tests that we have. We have quite a few cypress tests. This is what our dockerfile looks like
|
@dqiubread Thanks for confirming my suspicion about the custom naming - I'll get that passed along to the team to address. I wonder if the issue is not using a custom
|
I got it working by adding typescript. I dont think adding the /e2e would make a difference would it? |
@dqiubread The intent of my suggestion was to have your Cypress project files within a subdirectory on the image. My suspicion is that the hang you experience is from your current Cypress project directory being the root of the image - the current logic scans the project directory for Typescript files, and since your project directory is effectively I have a PR open to consider the location of a custom Cypress config file when checking for Typescript support - this should mitigate the issue for you without having to add |
The code for this is done in cypress-io/cypress#25254, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
When Typescript is not installed as a dev dependency in package.json. The image hangs in codefresh stuck on the detect detect for a few minutes before continuing.
cypress:scaffold-config:detect Resolved typescript from /node_modules/typescript/lib/typescript.js +0ms
After removing the prettier-eslint library we noticed that the message changed and the CI Pipeline continues without hanging with this message.
cypress:scaffold-config:detect No typescript installed - using js +0ms
Looking in the cypress repo it seems to be this change here listed in the below PR. It seems that the check was changed to check for a typescript lib in the nodemodules library and defaults to typescript even though the package we are using is using typescript but our cypress project was using javascript.
309c31f#diff-ce8622dde6ed83c3ceb55b5766f02a3dd06e26b84a51e0de44083e9246a768bfR123-R140
Desired behavior
If the cypress repo is a javascript repo and we have a package is that using typescript we should not need to install typescript as a dependency in the package.json file
Test code to reproduce
Step to Repro:
cypress run --spec "cypress/e2e/start.spec.js" --browser chrome
DockerFile
FROM cypress/included:10.0.2
Cypress Version
10.0.2 - 11.1.0
Node version
16.16
Operating System
Docker Image on Linux in CI environment
Debug Logs
Other
The fix for us was to also install typescript into our node packages even though we have a javascript cypress project.
Before
"devDependencies": { "@babel/core": "^7.13.1", "@babel/eslint-parser": "^7.13.4", "@babel/eslint-plugin": "^7.13.0", "@babel/plugin-proposal-class-properties": "^7.13.0", "@cypress/instrument-cra": "^1.4.0", "@cypress/skip-test": "^2.6.0", "@cypress/snapshot": "^2.1.7", "@testing-library/cypress": "^8.0.2", "axe-core": "^4.5.2", "babel-plugin-istanbul": "^6.0.0", "cypress": "^11.1.0", "cypress-audit": "^0.3.0", "cypress-postgres": "^1.1.1", "cypress-recurse": "^1.23.0", "cypress-repeat": "^2.2.1", "eslint-plugin-cypress": "^2.11.2", "eslint-plugin-unused-imports": "^2.0.0", "gmail-tester": "^1.3.1", "husky": "^6.0.0", "junit-report-merger": "^3.0.6", "nyc": "^15.1.0", "prettier-eslint-cli": "^5.0.1" },
After
"devDependencies": { "@babel/core": "^7.13.1", "@babel/eslint-parser": "^7.13.4", "@babel/eslint-plugin": "^7.13.0", "@babel/plugin-proposal-class-properties": "^7.13.0", "@cypress/instrument-cra": "^1.4.0", "@cypress/skip-test": "^2.6.0", "@cypress/snapshot": "^2.1.7", "@testing-library/cypress": "^8.0.2", "axe-core": "^4.5.2", "babel-plugin-istanbul": "^6.0.0", "cypress": "^11.1.0", "cypress-audit": "^0.3.0", "cypress-postgres": "^1.1.1", "cypress-recurse": "^1.23.0", "cypress-repeat": "^2.2.1", "eslint-plugin-cypress": "^2.11.2", "eslint-plugin-unused-imports": "^2.0.0", "gmail-tester": "^1.3.1", "husky": "^6.0.0", "junit-report-merger": "^3.0.6", "nyc": "^15.1.0", "prettier-eslint-cli": "^7.1.0", "typescript": "^4.9.3" },
The text was updated successfully, but these errors were encountered: