Skip to content

[test optimization] Fix cypress attempt to fix #7767

Merged
juan-fernandez merged 2 commits intomasterfrom
juan-fernandez/fix-cypress-attempt-to-fix-exit-code
Mar 16, 2026
Merged

[test optimization] Fix cypress attempt to fix #7767
juan-fernandez merged 2 commits intomasterfrom
juan-fernandez/fix-cypress-attempt-to-fix-exit-code

Conversation

@juan-fernandez
Copy link
Copy Markdown
Collaborator

@juan-fernandez juan-fernandez commented Mar 13, 2026

What does this PR do?

Fixes the Cypress.on('fail') handler to suppress failures for quarantined and disabled tests regardless of attempt-to-fix (ATF) status, aligning with the test management spec.

Motivation

The spec states: "If test is tagged with test.test_management.is_test_disabled or test.test_management.is_quarantined, then the test results are ignored."

The previous condition isQuarantined && !isAttemptToFix excluded quarantined+ATF tests from suppression, causing Cypress to exit with code 1 even though the test was quarantined. Plain ATF tests (not quarantined/disabled) should still propagate failures — only the quarantined/disabled status determines whether results are ignored.

Changes

  • packages/datadog-plugin-cypress/src/support.js — Change suppression condition from isQuarantined && !isAttemptToFix to isQuarantined || isDisabled.
  • integration-tests/cypress/cypress.spec.js — Update exit code assertion to expect 0 when isQuarantined or isDisabled. Remove resolved TODO comment about quarantined+ATF tests not being suppressed.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 13, 2026

Overall package size

Self size: 4.97 MB
Deduped: 5.82 MB
No deduping: 5.82 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.0 | 81.15 kB | 815.98 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.34%. Comparing base (3e972c8) to head (cd47697).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7767      +/-   ##
==========================================
- Coverage   80.43%   80.34%   -0.09%     
==========================================
  Files         741      743       +2     
  Lines       32173    32296     +123     
==========================================
+ Hits        25877    25949      +72     
- Misses       6296     6347      +51     
Flag Coverage Δ
aiguard-macos 39.06% <ø> (+0.12%) ⬆️
aiguard-ubuntu 39.18% <ø> (+0.12%) ⬆️
aiguard-windows 38.91% <ø> (+0.12%) ⬆️
apm-capabilities-tracing-macos 48.90% <ø> (-0.01%) ⬇️
apm-capabilities-tracing-ubuntu 48.98% <ø> (+0.04%) ⬆️
apm-capabilities-tracing-windows 48.67% <ø> (+<0.01%) ⬆️
apm-integrations-child-process 38.37% <ø> (-0.13%) ⬇️
apm-integrations-couchbase-18 37.28% <ø> (-0.13%) ⬇️
apm-integrations-couchbase-eol 37.75% <ø> (-0.13%) ⬇️
apm-integrations-oracledb 37.59% <ø> (-0.12%) ⬇️
appsec-express 55.17% <ø> (-0.10%) ⬇️
appsec-fastify 51.51% <ø> (-0.10%) ⬇️
appsec-graphql 51.72% <ø> (-0.09%) ⬇️
appsec-kafka 44.24% <ø> (-0.11%) ⬇️
appsec-ldapjs 43.90% <ø> (-0.11%) ⬇️
appsec-lodash 43.56% <ø> (-0.11%) ⬇️
appsec-macos 58.17% <ø> (-0.11%) ⬇️
appsec-mongodb-core 48.68% <ø> (-0.10%) ⬇️
appsec-mongoose 49.34% <ø> (-0.10%) ⬇️
appsec-mysql 50.78% <ø> (-0.10%) ⬇️
appsec-node-serialize 43.08% <ø> (-0.11%) ⬇️
appsec-passport 47.52% <ø> (-0.11%) ⬇️
appsec-postgres 50.50% <ø> (-0.10%) ⬇️
appsec-sourcing 42.49% <ø> (-0.11%) ⬇️
appsec-template 43.25% <ø> (-0.11%) ⬇️
appsec-ubuntu 58.25% <ø> (-0.11%) ⬇️
appsec-windows 58.03% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-bluebird 32.24% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-body-parser 40.39% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-child_process 37.68% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-cookie-parser 34.22% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-express 34.54% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.35% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-express-session 40.02% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-fs 31.86% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-generic-pool 29.66% <ø> (-0.04%) ⬇️
instrumentations-instrumentation-http 39.66% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-knex 32.24% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-mongoose 33.37% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-multer 40.14% <ø> (-0.12%) ⬇️
instrumentations-instrumentation-mysql2 38.14% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-passport 43.95% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-passport-http 43.61% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-passport-local 44.15% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-pg 37.58% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-promise 32.17% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-promise-js 32.18% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-q 32.22% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-url 32.14% <ø> (-0.13%) ⬇️
instrumentations-instrumentation-when 32.19% <ø> (-0.13%) ⬇️
llmobs-ai 42.13% <ø> (-0.12%) ⬇️
llmobs-anthropic 40.16% <ø> (-0.07%) ⬇️
llmobs-bedrock 39.11% <ø> (-0.11%) ⬇️
llmobs-google-genai 39.66% <ø> (-0.11%) ⬇️
llmobs-langchain 39.89% <ø> (-0.12%) ⬇️
llmobs-openai 43.84% <ø> (-0.12%) ⬇️
llmobs-vertex-ai 39.85% <ø> (-0.19%) ⬇️
platform-core 31.47% <ø> (-0.07%) ⬇️
platform-esbuild 34.42% <ø> (-0.07%) ⬇️
platform-instrumentations-misc 48.35% <ø> (-0.05%) ⬇️
platform-shimmer 37.56% <ø> (-0.07%) ⬇️
platform-unit-guardrails 32.89% <ø> (-0.07%) ⬇️
plugins-azure-durable-functions 25.62% <ø> (?)
plugins-azure-event-hubs 25.79% <ø> (-0.05%) ⬇️
plugins-azure-service-bus 25.15% <ø> (-0.04%) ⬇️
plugins-bullmq 44.04% <ø> (-0.23%) ⬇️
plugins-cassandra 37.63% <ø> (-0.12%) ⬇️
plugins-cookie 26.84% <ø> (-0.05%) ⬇️
plugins-cookie-parser 26.63% <ø> (-0.05%) ⬇️
plugins-crypto 26.73% <ø> (-0.06%) ⬇️
plugins-dd-trace-api 38.20% <ø> (-0.13%) ⬇️
plugins-express-mongo-sanitize 26.78% <ø> (-0.05%) ⬇️
plugins-express-session 26.59% <ø> (-0.05%) ⬇️
plugins-fastify 42.10% <ø> (-0.12%) ⬇️
plugins-fetch 38.19% <ø> (-0.12%) ⬇️
plugins-fs 38.47% <ø> (-0.13%) ⬇️
plugins-generic-pool 25.83% <ø> (-0.05%) ⬇️
plugins-google-cloud-pubsub 45.31% <ø> (-0.12%) ⬇️
plugins-grpc 40.78% <ø> (-0.12%) ⬇️
plugins-handlebars 26.82% <ø> (-0.05%) ⬇️
plugins-hapi 40.02% <ø> (-0.12%) ⬇️
plugins-hono 40.28% <ø> (-0.12%) ⬇️
plugins-ioredis 38.28% <ø> (-0.13%) ⬇️
plugins-knex 26.46% <ø> (-0.04%) ⬇️
plugins-ldapjs 24.32% <ø> (-0.04%) ⬇️
plugins-light-my-request 26.19% <ø> (-0.05%) ⬇️
plugins-limitd-client 32.52% <ø> (-0.13%) ⬇️
plugins-lodash 25.92% <ø> (-0.05%) ⬇️
plugins-mariadb 39.32% <ø> (-0.13%) ⬇️
plugins-memcached 38.00% <ø> (-0.14%) ⬇️
plugins-microgateway-core 39.08% <ø> (-0.12%) ⬇️
plugins-moleculer 40.37% <ø> (-0.12%) ⬇️
plugins-mongodb 39.02% <ø> (-0.12%) ⬇️
plugins-mongodb-core 38.85% <ø> (-0.13%) ⬇️
plugins-mongoose 38.71% <ø> (-0.12%) ⬇️
plugins-multer 26.59% <ø> (-0.05%) ⬇️
plugins-mysql 39.01% <ø> (-0.13%) ⬇️
plugins-mysql2 39.11% <ø> (-0.13%) ⬇️
plugins-node-serialize 26.89% <ø> (-0.05%) ⬇️
plugins-opensearch 37.46% <ø> (-0.13%) ⬇️
plugins-passport-http 26.64% <ø> (-0.05%) ⬇️
plugins-postgres 35.50% <ø> (-0.12%) ⬇️
plugins-process 26.73% <ø> (-0.06%) ⬇️
plugins-pug 26.84% <ø> (-0.05%) ⬇️
plugins-redis 38.74% <ø> (-0.13%) ⬇️
plugins-router 42.83% <ø> (-0.26%) ⬇️
plugins-sequelize 25.43% <ø> (-0.05%) ⬇️
plugins-test-and-upstream-amqp10 38.35% <ø> (-0.13%) ⬇️
plugins-test-and-upstream-amqplib 43.73% <ø> (-0.13%) ⬇️
plugins-test-and-upstream-apollo 38.98% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-avsc 38.53% <ø> (-0.13%) ⬇️
plugins-test-and-upstream-bunyan 33.78% <ø> (-0.13%) ⬇️
plugins-test-and-upstream-connect 40.68% <ø> (-0.12%) ⬇️
plugins-test-and-upstream-graphql 39.97% <ø> (-0.13%) ⬇️
plugins-test-and-upstream-koa 40.27% <ø> (-0.12%) ⬇️
plugins-test-and-upstream-protobufjs 38.75% <ø> (-0.13%) ⬇️
plugins-test-and-upstream-rhea 43.93% <ø> (-0.11%) ⬇️
plugins-undici 38.97% <ø> (-0.12%) ⬇️
plugins-url 26.73% <ø> (-0.06%) ⬇️
plugins-valkey 37.94% <ø> (-0.13%) ⬇️
plugins-vm 26.73% <ø> (-0.06%) ⬇️
plugins-winston 33.97% <ø> (-0.12%) ⬇️
plugins-ws 41.73% <ø> (-0.12%) ⬇️
profiling-macos 39.77% <ø> (-0.13%) ⬇️
profiling-ubuntu 39.90% <ø> (-0.13%) ⬇️
profiling-windows 41.09% <ø> (-0.12%) ⬇️
serverless-azure-functions-client 25.50% <ø> (-0.04%) ⬇️
serverless-azure-functions-eventhubs 25.50% <ø> (-0.04%) ⬇️
serverless-azure-functions-servicebus 25.50% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-prod-us1-5

This comment has been minimized.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 13, 2026

Benchmarks

Benchmark execution time: 2026-03-16 11:16:42

Comparing candidate commit cd47697 in PR branch juan-fernandez/fix-cypress-attempt-to-fix-exit-code with baseline commit 3e972c8 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 229 metrics, 31 unstable metrics.

@juan-fernandez juan-fernandez marked this pull request as ready for review March 13, 2026 15:54
@juan-fernandez juan-fernandez requested a review from a team as a code owner March 13, 2026 15:54
Copy link
Copy Markdown
Member

@anmarchenko anmarchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In spec we ignore the failure for attempt to fix only if test is quarantined or disbaled:

If test is tagged with test.test_management.is_test_disabled or test.test_management.is_quarantined tag, then the test results are ignored (reported to the test framework as skipped, passed, or quarantined, whatever is easier to implement and available in the test framework) 

…less of ATF status

Per spec, quarantined and disabled test results are always ignored.
The previous code excluded quarantined+ATF tests from suppression
via `isQuarantined && !isAttemptToFix`. This changes the condition
to `isQuarantined || isDisabled` so failures are suppressed for any
quarantined or disabled test, whether or not it is also attempt-to-fix.

Plain ATF tests (not quarantined/disabled) still propagate failures
as expected by the spec.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@juan-fernandez juan-fernandez force-pushed the juan-fernandez/fix-cypress-attempt-to-fix-exit-code branch from 1882fe8 to 64b8362 Compare March 16, 2026 09:42
anmarchenko
anmarchenko previously approved these changes Mar 16, 2026
The support.js change removed 2 lines, shifting the bundled line
number from 246 to 244 for the plain JS invocationDetails test.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@juan-fernandez juan-fernandez merged commit 545939d into master Mar 16, 2026
790 checks passed
@juan-fernandez juan-fernandez deleted the juan-fernandez/fix-cypress-attempt-to-fix-exit-code branch March 16, 2026 12:26
@dd-octo-sts dd-octo-sts bot mentioned this pull request Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants