-
Notifications
You must be signed in to change notification settings - Fork 335
[BUG]: before:run event is not working with dd-trace-js #5496
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
Comments
Hi @mekhron, are you trying to run your tests in interactive mode? If so, we have a Known limitation for that type of case (Docs Datadog). If not, could you share a bit more info about how you're running the tests? |
@Mariovido I am running either way. My before:run event is not firing even when I run in headless mode. Here are the vents I have in cypress.config.js:
So the dd-trace events are firing fine (after:run and after:spec), but the before:run is not logging anything. Here is the command how I run: Thanks for taking a look at this. |
@mekhron I tried reproducing your case and I am able to log it ( Code samplemodule.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
require("dd-trace/ci/cypress/plugin")(on, config);
on("before:run", () => {
console.log("BEFORE RUN");
});
// other plugins
on("after:run", (details) => {
console.log("AFTER RUN");
// other 'after:run' handlers
// important that this function call is returned
return require("dd-trace/ci/cypress/after-run")(details);
});
on("after:spec", (...args) => {
console.log("AFTER SPEC");
// other 'after:spec' handlers
// Important that this function call is returned
// Important that all the arguments are passed
return require("dd-trace/ci/cypress/after-spec")(...args);
});
},
supportFile: "cypress/support/e2e.js",
},
}); Which Cypress version are you using? |
@Mariovido 14.2.1 |
@mekhron I tried with that version and it worked. Let's do one thing, could you reach out to support to be able to share your logs? Mainly what I would like to see after is:
|
Tracer Version(s)
5.40.0
Node.js Version(s)
20.16.0
Bug Report
When I have return
require('dd-trace/ci/cypress/plugin')(on, config);
in config, my events are not firing. Whenever I return just the config, events are firing as expected.Reproduction Code
No response
Error Logs
No response
Tracer Config
No response
Operating System
No response
Bundling
Unsure
The text was updated successfully, but these errors were encountered: