Open bahmutov opened 1 year ago
My team is having this problem with the built-in @cypress/grep
package and the grepTags
environment variable combined with the --spec
option. Here's an example run showing this issue:
$ npm run cy:run-report -- --spec='./cypress/e2e/poc/**/*.cy.*' --env testEnv='latest',grepTags='@regression'
> cypress@1.0.0 cy:run-report
> cypress run --browser chrome --reporter junit --reporter-options "mochaFile=cypress/results/Test-[hash].xml,toConsole=true" --spec=./cypress/e2e/poc/**/*.cy.* --env testEnv=latest,grepTags=@regression
DevTools listening on ws://127.0.0.1:61839/devtools/browser/d59a1760-3a01-4c9d-8e95-46e282048d67
@cypress/grep: filtering using tag(s) "@regression"
@cypress/grep: will omit filtered tests
Couldn't determine Mocha version
Can't run because no spec files were found.
We searched for specs matching this glob pattern:
> C:\Git\cypress\cypress\e2e\poc\**\*.cy.*
Sounds like this issue is asking for the same feature as https://github.com/cypress-io/cypress/issues/23019
+1 on needing this, my team just got bit by it today. We filter our tests down based on a network request to an external service that we use to temporarily "quarantine" tests that start failing unexpectedly - i.e. the test is dependent on some live service that we didn't anticipate, or we have a test that seems stable when it's added, but then starts failing 2% of the time when run on CI many times a day. One of our small applications only has two Cypress tests, and we ended up needing to quarantine both of them yesterday - now the build is failing, because Cypress isn't finding any valid spec files to run.
What would you like?
Let's say I have a plugin like cypress-split or cy-grep that changes the list of specs to run. Sometimes there might be no specs to run at all. It would be nice if the plugin could so something like this and Cypress would exit with code zero
Currently, if you set an empty spec list, then it exits with 1
Why is this needed?
Expecting no specs might be useful. It will be useful for my plugins for sure
Other
No response