Skip to content

fix(cypress): scope failure media uploads to screenshots#9154

Merged
juan-fernandez merged 1 commit into
xinye.ji/cypress-failure-media-v2from
juan-fernandez/cypress-failure-screenshots
Jun 30, 2026
Merged

fix(cypress): scope failure media uploads to screenshots#9154
juan-fernandez merged 1 commit into
xinye.ji/cypress-failure-media-v2from
juan-fernandez/cypress-failure-screenshots

Conversation

@juan-fernandez

Copy link
Copy Markdown
Collaborator

Summary

  • keep the Cypress failure media work focused on screenshots by removing video upload config, code, and tests
  • move DD_TEST_FAILURE_SCREENSHOTS_ENABLED under the Test Optimization supported config namespace
  • make EVP proxy unsupported behavior explicit in Cypress tests and user warnings
  • use DD_API_KEY for screenshot media uploads

Testing

  • ./node_modules/.bin/mocha packages/dd-trace/test/config/generated-config-types.spec.js packages/dd-trace/test/config/index.spec.js --grep "internalPropertyName|test failure screenshots|generated config types|unsupported config|property surface"
  • ./node_modules/.bin/mocha packages/dd-trace/test/ci-visibility/exporters/ci-visibility-exporter.spec.js --grep "canUploadTestScreenshots"
  • ./node_modules/.bin/mocha packages/dd-trace/test/ci-visibility/requests/upload-test-screenshot.spec.js
  • ./node_modules/.bin/eslint integration-tests/cypress-esm-config.mjs integration-tests/cypress.config.js integration-tests/cypress/cypress-reporting.spec.js integration-tests/cypress/e2e/manual-screenshot-before-fail.js packages/datadog-plugin-cypress/src/cypress-plugin.js packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js packages/dd-trace/test/ci-visibility/exporters/ci-visibility-exporter.spec.js packages/dd-trace/test/ci-visibility/requests/upload-test-screenshot.spec.js packages/dd-trace/test/config/index.spec.js
  • env -u OTEL_TRACES_EXPORTER -u OTEL_LOGS_EXPORTER -u OTEL_METRICS_EXPORTER CYPRESS_VERSION=12.0.0 CYPRESS_MODULE_TYPE=commonJS ./node_modules/.bin/mocha --timeout 180000 integration-tests/cypress/cypress-reporting.spec.js --grep "reporting with"

Keep this branch focused on Cypress failure screenshots by removing the video upload flag, upload path, and related tests.

Move DD_TEST_FAILURE_SCREENSHOTS_ENABLED into the Test Optimization config namespace, make EVP proxy unsupported behavior explicit in tests and warnings, and use DD_API_KEY for screenshot media uploads.

Tests: ./node_modules/.bin/mocha packages/dd-trace/test/config/generated-config-types.spec.js packages/dd-trace/test/config/index.spec.js --grep "internalPropertyName|test failure screenshots|generated config types|unsupported config|property surface"

Tests: ./node_modules/.bin/mocha packages/dd-trace/test/ci-visibility/exporters/ci-visibility-exporter.spec.js --grep "canUploadTestScreenshots"

Tests: ./node_modules/.bin/mocha packages/dd-trace/test/ci-visibility/requests/upload-test-screenshot.spec.js

Tests: ./node_modules/.bin/eslint integration-tests/cypress-esm-config.mjs integration-tests/cypress.config.js integration-tests/cypress/cypress-reporting.spec.js integration-tests/cypress/e2e/manual-screenshot-before-fail.js packages/datadog-plugin-cypress/src/cypress-plugin.js packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js packages/dd-trace/test/ci-visibility/exporters/ci-visibility-exporter.spec.js packages/dd-trace/test/ci-visibility/requests/upload-test-screenshot.spec.js packages/dd-trace/test/config/index.spec.js

Tests: env -u OTEL_TRACES_EXPORTER -u OTEL_LOGS_EXPORTER -u OTEL_METRICS_EXPORTER CYPRESS_VERSION=12.0.0 CYPRESS_MODULE_TYPE=commonJS ./node_modules/.bin/mocha --timeout 180000 integration-tests/cypress/cypress-reporting.spec.js --grep "reporting with"
@juan-fernandez
juan-fernandez force-pushed the juan-fernandez/cypress-failure-screenshots branch from a2c1103 to 4c31138 Compare June 30, 2026 15:11
@juan-fernandez
juan-fernandez marked this pull request as ready for review June 30, 2026 15:12
@juan-fernandez
juan-fernandez requested review from a team as code owners June 30, 2026 15:12
@juan-fernandez
juan-fernandez requested review from BridgeAR and removed request for a team June 30, 2026 15:12
@dd-octo-sts

dd-octo-sts Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.44 MB
Deduped: 7.51 MB
No deduping: 7.51 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.2.0 | 104.26 kB | 843.44 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

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

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 30, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 2 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-js | validate_supported_configurations_v2_local_file   View in Datadog   GitLab

Test Optimization | integration-cypress (latest, node-latest, commonJS, cypress-itr)   View in Datadog   GitHub Actions

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4c31138 | Docs | Datadog PR Page | Give us feedback!

@juan-fernandez
juan-fernandez merged commit a4c8ca7 into xinye.ji/cypress-failure-media-v2 Jun 30, 2026
984 of 989 checks passed
@juan-fernandez
juan-fernandez deleted the juan-fernandez/cypress-failure-screenshots branch June 30, 2026 15:22
@pr-commenter

pr-commenter Bot commented Jun 30, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-30 15:27:22

Comparing candidate commit 4c31138 in PR branch juan-fernandez/cypress-failure-screenshots with baseline commit e6ccddf in branch xinye.ji/cypress-failure-media-v2.

📊 Benchmarking dashboard

Found 3 performance improvements and 0 performance regressions! Performance is the same for 2247 metrics, 36 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:debugger-line-probe-with-snapshot-default-24

  • 🟩 cpu_user_time [-867.115ms; -178.069ms] or [-10.980%; -2.255%]
  • 🟩 execution_time [-877.305ms; -174.537ms] or [-10.221%; -2.033%]
  • 🟩 throughput [+77.913op/s; +393.895op/s] or [+2.073%; +10.482%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-20

  • unstable execution_time [-190.882ms; +183.118ms] or [-5.124%; +4.916%]

scenario:appsec-appsec-enabled-24

  • unstable execution_time [-178.501ms; +169.130ms] or [-6.804%; +6.447%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-204.399ms; +207.916ms] or [-8.084%; +8.223%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-151.654ms; +157.640ms] or [-5.282%; +5.490%]

scenario:appsec-control-20

  • unstable execution_time [-150.506ms; +167.150ms] or [-8.657%; +9.614%]

scenario:appsec-control-24

  • unstable execution_time [-103876.864µs; +103579.464µs] or [-8.555%; +8.530%]

scenario:appsec-control-26

  • unstable execution_time [-113544.263µs; +115480.597µs] or [-9.366%; +9.526%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-2144.473ms; +3278.160ms] or [-23.023%; +35.194%]
  • unstable execution_time [-2128.660ms; +3306.278ms] or [-21.265%; +33.029%]
  • unstable instructions [-19.4G instructions; +29.7G instructions] or [-25.130%; +38.485%]
  • unstable max_rss_usage [-5.805MB; +10.275MB] or [-3.632%; +6.429%]
  • unstable throughput [-728.380op/s; +479.929op/s] or [-22.180%; +14.614%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1880.812ms; +123.453ms] or [-22.811%; +1.497%]
  • unstable execution_time [-1910.624ms; +127.540ms] or [-21.431%; +1.431%]
  • unstable instructions [-16.1G instructions; +1.1G instructions] or [-23.985%; +1.567%]
  • unstable throughput [+10.615op/s; +636.436op/s] or [+0.288%; +17.266%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable cpu_user_time [-1707.380ms; +563.095ms] or [-21.572%; +7.115%]
  • unstable execution_time [-1737.311ms; +584.264ms] or [-20.176%; +6.785%]
  • unstable instructions [-14.7G instructions; +4.7G instructions] or [-22.785%; +7.330%]
  • unstable throughput [-173.090op/s; +501.087op/s] or [-4.506%; +13.045%]

scenario:debugger-line-probe-without-snapshot-26

  • unstable cpu_user_time [-2925.351ms; +4173.926ms] or [-27.683%; +39.499%]
  • unstable execution_time [-2989.761ms; +4263.499ms] or [-26.539%; +37.846%]
  • unstable instructions [-25.5G instructions; +36.7G instructions] or [-28.686%; +41.369%]
  • unstable max_rss_usage [-9.809MB; +12.722MB] or [-6.019%; +7.806%]
  • unstable throughput [-936.615op/s; +647.782op/s] or [-31.034%; +21.464%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-449.426ms; +129.396ms] or [-9.525%; +2.742%]
  • unstable execution_time [-445.067ms; +129.475ms] or [-9.278%; +2.699%]
  • unstable throughput [-45327.513op/s; +151946.473op/s] or [-2.592%; +8.688%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-22.117MB; +46.524MB] or [-5.886%; +12.382%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-509.235ms; +764.794ms] or [-4.914%; +7.380%]
  • unstable execution_time [-515.509ms; +796.870ms] or [-4.843%; +7.486%]
  • unstable max_rss_usage [-32.009MB; +65.447MB] or [-16.089%; +32.896%]
  • unstable throughput [-5.288op/s; +3.553op/s] or [-6.990%; +4.696%]

scenario:plugin-pg-service-20

  • unstable cpu_user_time [-76.167ms; +110.061ms] or [-4.777%; +6.902%]
  • unstable execution_time [-76.220ms; +110.319ms] or [-4.774%; +6.910%]

scenario:spans-finish-later-26

  • unstable max_rss_usage [-5.982MB; +9.295MB] or [-4.056%; +6.302%]

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The PR fixes a real latent bug: getConfig().apiKey is always undefined (confirmed by running the actual config module), so every screenshot upload in the base branch would have failed with "DD_API_KEY is required". The fix — using getConfig().DD_API_KEY — is consistent with all other CI visibility upload paths. All other changes (video removal, config namespace migration, EVP-proxy warning) are clean and pass the full unit test suite.

Was this helpful? React 👍 or 👎

📊 Validated against 9 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 4c31138 · What is Autotest? · Any feedback? Reach out in #autotest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant