-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test visibility] Speed up cypress tests (#4457)
- Loading branch information
1 parent
b0acc4f
commit 123b365
Showing
2 changed files
with
58 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
const ddAfterRun = require('dd-trace/ci/cypress/after-run') | ||
const ddAfterSpec = require('dd-trace/ci/cypress/after-spec') | ||
|
||
module.exports = (on, config) => { | ||
if (process.env.CYPRESS_ENABLE_INCOMPATIBLE_PLUGIN) { | ||
require('cypress-fail-fast/plugin')(on, config) | ||
} | ||
if (process.env.SPEC_PATTERN) { | ||
config.testFiles = process.env.SPEC_PATTERN.replace('cypress/e2e/', '') | ||
} | ||
if (process.env.CYPRESS_ENABLE_AFTER_RUN_CUSTOM) { | ||
on('after:run', (...args) => { | ||
// do custom stuff | ||
// and call after-run at the end | ||
return ddAfterRun(...args) | ||
}) | ||
} | ||
if (process.env.CYPRESS_ENABLE_AFTER_SPEC_CUSTOM) { | ||
on('after:spec', (...args) => { | ||
// do custom stuff | ||
// and call after-spec at the end | ||
return ddAfterSpec(...args) | ||
}) | ||
} | ||
require('dd-trace/ci/cypress/plugin')(on, config) | ||
return config | ||
} |