Getting a pipeline cache artifact ....Failed to get cached item & npm ERR! could not determine executable to run for npx cypress run #4468
flaskvacuum
started this conversation in
General
Replies: 1 comment
-
any help please? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi guys,
i am setting up my azure pipeline to run cypress. This are the recommended template to use and i was able to run the cache npm packages & cache the cypress binary successfully. Thus was able to proceed with the Install NPM dependencies. I was able to see npm cache list result and cypress cache list. But a closer look at the cache npm packages & cache cypress binary i saw this error:
Getting a pipeline cache artifact with the following fingerprint:
npm|"Windows_NT"|TUjhsfafaiosvoswfafhjhUUHkj
.Failed to get cached item. Can i actually ignore it since my install NPM dependencies are ok.
2nd issues is:
the RUM Cypress tests, i was trying to run npx cypress run as part of the script:
npx cypress run --spec $(System.DefaultWorkingDirectory)\cypress\e2e\SAM-UI-R1-001.cy.js
error encountered:
"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\cypressAgent_temp\cc43252b-4693-4096-ae59-8855999da11c.cmd""
npm ERR! could not determine executable to run
is there some dependencies i have missed ?
package.json
{ "name": "cypress_project", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "test", "cypress:open": "cypress open", "cy:verify": "cypress verify", "cy:info": "cypress info", "cy:version": "cypress version", "cy:cache:list": "cypress cache list", "np:cache:list": "npm cache ls" }, "keywords": ["cypress"], "author": "ITS_DEVOPS", "license": "ISC", "devDependencies": { "cypress": "^13.3.1" } }
azure-ci.yml
`
jobs:
pool:
name: 'cypressPool' # Ensure the agent pool name matches the actual name in your Azure DevOps organization
vmImage: 'ubuntu-latest'
strategy:
parallel: 1
steps:
task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'
task: CacheBeta@1
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
path: /home/vsts/.npm
restoreKeys: npm | "$(Agent.OS)" | package-lock.json
cacheHitVar: NPM_CACHE_RESTORED
displayName: Cache NPM packages
task: CacheBeta@1
inputs:
key: cypress | $(Agent.OS) | package-lock.json
path: /home/vsts/.cache/Cypress
restoreKeys: cypress | $(Agent.OS) | package-lock.json
displayName: Cache Cypress binary
script: npm ci
displayName: 'Install NPM dependencies'
script: npm run cy:verify
displayName: 'Cypress verify'
script: npm run cy:info
displayName: 'Cypress info'
script: npm run cy:version
displayName: 'Cypress version'
script: npm run cy:cache:list
displayName: 'Cypress cache list'
script: npm run np:cache:list
displayName: 'npm cache list'
script: |
npx print-env AGENT
npx print-env BUILD
npx print-env SYSTEM
#npm run start &
npx cypress run --record --parallel --ci-build-id $BUILD_BUILDNUMBER --group "Azure CI"
#npx cypress run --spec $(System.DefaultWorkingDirectory)\cypress\e2e\SAM-UI-R1-001.cy.js --browser edge --headed
displayName: 'Run Cypress tests'
env:
TERM: xterm
`
Beta Was this translation helpful? Give feedback.
All reactions