Skip to content

[test optimization] Prevent ATF tests from being incorrectly tagged as new in cucumber#7961

Merged
juan-fernandez merged 6 commits intomasterfrom
juan-fernandez/fix-atf-is-new-other-frameworks
Apr 10, 2026
Merged

[test optimization] Prevent ATF tests from being incorrectly tagged as new in cucumber#7961
juan-fernandez merged 6 commits intomasterfrom
juan-fernandez/fix-atf-is-new-other-frameworks

Conversation

@juan-fernandez
Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes the same bug as #7960 but in the Cucumber instrumentation: attempt-to-fix (ATF) tests were incorrectly tagged as test.is_new: true when the known tests feature was enabled. The shared numRetriesByPickleId map was used to determine if a test was new, but ATF tests are also added to this map.

Introduces a dedicated newTestPickleIds Set populated only when a test is genuinely absent from the known tests list.

Also adds regression integration tests across all test frameworks (Cucumber, Mocha, Playwright, Vitest) that assert ATF tests present in the known tests list are never tagged with test.is_new.

Motivation

Same root cause as #7960 (Jest fix). The Cucumber instrumentation had the identical pattern of using a shared retry-tracking map (numRetriesByPickleId) to determine if a test is new, which incorrectly detected ATF tests as new. This caused EFD's lenient pass criteria to override ATF's strict criteria.

Mocha, Playwright, and Vitest are not affected (they use dedicated data structures for new-test tracking), but regression tests are added for all frameworks to prevent future regressions.

Additional Notes

  • Cucumber test verified to fail without the fix and pass with it.
  • Mocha, Playwright, and Vitest tests pass as-is (no code fix needed, just regression tests).

…n cucumber

Same bug as jest: the shared `numRetriesByPickleId` map was used to
determine if a test is new, but ATF tests are also added to this map.
Introduces a dedicated `newTestPickleIds` Set for genuine new-test tracking.

Also adds regression integration tests for all frameworks (cucumber,
mocha, playwright, vitest) that assert ATF tests present in the known
tests list are never tagged with `test.is_new`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@juan-fernandez juan-fernandez requested a review from a team as a code owner April 9, 2026 10:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Overall package size

Self size: 5.48 MB
Deduped: 6.32 MB
No deduping: 6.32 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 bot commented Apr 9, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 33.33%
Overall Coverage: 68.24% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ee30798 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Apr 9, 2026

Benchmarks

Benchmark execution time: 2026-04-10 08:52:39

Comparing candidate commit ee30798 in PR branch juan-fernandez/fix-atf-is-new-other-frameworks with baseline commit abc727b in branch master.

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

@juan-fernandez juan-fernandez changed the title fix(ci-vis): prevent ATF tests from being incorrectly tagged as new in cucumber [test optimization] Prevent ATF tests from being incorrectly tagged as new in cucumber Apr 9, 2026
juan-fernandez and others added 2 commits April 9, 2026 13:12
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.82%. Comparing base (abc727b) to head (ee30798).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/datadog-instrumentations/src/cucumber.js 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7961   +/-   ##
=======================================
  Coverage   73.82%   73.82%           
=======================================
  Files         773      773           
  Lines       35972    35974    +2     
=======================================
+ Hits        26556    26559    +3     
+ Misses       9416     9415    -1     
Flag Coverage Δ
aiguard-macos 36.42% <ø> (-0.09%) ⬇️
aiguard-ubuntu 36.53% <ø> (-0.09%) ⬇️
aiguard-windows 36.33% <ø> (-0.09%) ⬇️
apm-capabilities-tracing-macos 48.41% <ø> (+0.03%) ⬆️
apm-capabilities-tracing-ubuntu 48.45% <ø> (ø)
apm-capabilities-tracing-windows 48.24% <ø> (+<0.01%) ⬆️
apm-integrations-child-process 36.06% <ø> (-0.10%) ⬇️
apm-integrations-couchbase-18 35.01% <ø> (-0.07%) ⬇️
apm-integrations-couchbase-eol 35.06% <ø> (-0.09%) ⬇️
apm-integrations-oracledb 35.03% <ø> (-0.09%) ⬇️
appsec-express 52.80% <ø> (-0.06%) ⬇️
appsec-fastify 49.27% <ø> (-0.07%) ⬇️
appsec-graphql 49.62% <ø> (+0.02%) ⬆️
appsec-kafka 42.10% <ø> (-0.08%) ⬇️
appsec-ldapjs 41.39% <ø> (-0.08%) ⬇️
appsec-lodash 41.42% <ø> (-0.08%) ⬇️
appsec-macos 56.74% <ø> (-0.07%) ⬇️
appsec-mongodb-core 46.04% <ø> (-0.07%) ⬇️
appsec-mongoose 46.60% <ø> (-0.07%) ⬇️
appsec-mysql 48.73% <ø> (-0.07%) ⬇️
appsec-node-serialize 40.59% <ø> (-0.08%) ⬇️
appsec-passport 44.55% <ø> (-0.08%) ⬇️
appsec-postgres 48.31% <ø> (-0.18%) ⬇️
appsec-sourcing 40.05% <ø> (-0.08%) ⬇️
appsec-stripe 42.31% <ø> (-0.08%) ⬇️
appsec-template 40.75% <ø> (-0.08%) ⬇️
appsec-ubuntu 56.82% <ø> (-0.07%) ⬇️
appsec-windows 56.62% <ø> (-0.07%) ⬇️
instrumentations-instrumentation-bluebird 29.79% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-body-parser 37.64% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-child_process 35.44% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-cookie-parser 31.73% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-express 31.95% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 31.85% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-express-session 37.27% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-fs 29.46% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-generic-pool 31.12% <ø> (ø)
instrumentations-instrumentation-http 36.88% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-knex 29.76% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-mongoose 30.88% <ø> (-0.16%) ⬇️
instrumentations-instrumentation-multer 37.42% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-mysql2 35.38% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-passport 41.17% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-passport-http 40.86% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-passport-local 41.36% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-pg 34.90% <ø> (-0.09%) ⬇️
instrumentations-instrumentation-promise 29.72% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-promise-js 29.73% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-q 29.76% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-url 29.72% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-when 29.74% <ø> (-0.10%) ⬇️
llmobs-ai 38.38% <ø> (-0.09%) ⬇️
llmobs-anthropic 37.84% <ø> (-0.09%) ⬇️
llmobs-bedrock 37.11% <ø> (-0.08%) ⬇️
llmobs-google-genai 37.53% <ø> (-0.08%) ⬇️
llmobs-langchain 37.00% <ø> (-0.18%) ⬇️
llmobs-openai 41.22% <ø> (-0.08%) ⬇️
llmobs-vertex-ai 37.70% <ø> (-0.09%) ⬇️
platform-core 31.10% <ø> (ø)
platform-esbuild 33.97% <ø> (ø)
platform-instrumentations-misc 40.97% <ø> (ø)
platform-shimmer 37.00% <ø> (ø)
platform-unit-guardrails 32.49% <ø> (ø)
platform-webpack 20.82% <33.33%> (+<0.01%) ⬆️
plugins-azure-durable-functions 25.87% <ø> (ø)
plugins-azure-event-hubs 26.03% <ø> (ø)
plugins-azure-service-bus 25.40% <ø> (ø)
plugins-bullmq 40.72% <ø> (-0.09%) ⬇️
plugins-cassandra 35.17% <ø> (-0.09%) ⬇️
plugins-cookie 27.06% <ø> (ø)
plugins-cookie-parser 26.85% <ø> (ø)
plugins-crypto 26.55% <ø> (ø)
plugins-dd-trace-api 35.42% <ø> (-0.10%) ⬇️
plugins-express-mongo-sanitize 26.99% <ø> (ø)
plugins-express-session 26.81% <ø> (ø)
plugins-fastify 39.35% <ø> (-0.09%) ⬇️
plugins-fetch 35.71% <ø> (-0.09%) ⬇️
plugins-fs 35.67% <ø> (-0.10%) ⬇️
plugins-generic-pool 25.92% <ø> (ø)
plugins-google-cloud-pubsub 43.02% <ø> (-0.08%) ⬇️
plugins-grpc 38.02% <ø> (-0.09%) ⬇️
plugins-handlebars 27.03% <ø> (ø)
plugins-hapi 37.23% <ø> (-0.09%) ⬇️
plugins-hono 37.50% <ø> (-0.09%) ⬇️
plugins-ioredis 35.61% <ø> (-0.09%) ⬇️
plugins-knex 26.67% <ø> (ø)
plugins-langgraph 35.05% <ø> (-0.09%) ⬇️
plugins-ldapjs 24.45% <ø> (ø)
plugins-light-my-request 26.41% <ø> (ø)
plugins-limitd-client 30.00% <ø> (-0.10%) ⬇️
plugins-lodash 26.00% <ø> (ø)
plugins-mariadb 36.48% <ø> (-0.09%) ⬇️
plugins-memcached 35.26% <ø> (-0.09%) ⬇️
plugins-microgateway-core 36.31% <ø> (-0.09%) ⬇️
plugins-moleculer 38.03% <ø> (-0.09%) ⬇️
plugins-mongodb 36.37% <ø> (-0.09%) ⬇️
plugins-mongodb-core 36.07% <ø> (-0.09%) ⬇️
plugins-mongoose 36.01% <ø> (-0.09%) ⬇️
plugins-multer 26.81% <ø> (ø)
plugins-mysql 36.35% <ø> (-0.09%) ⬇️
plugins-mysql2 36.33% <ø> (-0.09%) ⬇️
plugins-node-serialize 27.10% <ø> (ø)
plugins-opensearch 34.93% <ø> (-0.09%) ⬇️
plugins-passport-http 26.85% <ø> (ø)
plugins-postgres 34.31% <ø> (-0.11%) ⬇️
plugins-process 26.55% <ø> (ø)
plugins-pug 27.06% <ø> (ø)
plugins-redis 35.82% <ø> (-0.09%) ⬇️
plugins-router 39.98% <ø> (-0.09%) ⬇️
plugins-sequelize 25.68% <ø> (ø)
plugins-test-and-upstream-amqp10 35.63% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-amqplib 40.84% <ø> (-0.08%) ⬇️
plugins-test-and-upstream-apollo 36.50% <ø> (-0.08%) ⬇️
plugins-test-and-upstream-avsc 35.52% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-bunyan 31.16% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-connect 37.83% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-graphql 37.17% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-koa 37.44% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-protobufjs 35.73% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-rhea 40.94% <ø> (-0.09%) ⬇️
plugins-undici 36.52% <ø> (-0.09%) ⬇️
plugins-url 26.55% <ø> (ø)
plugins-valkey 35.29% <ø> (-0.09%) ⬇️
plugins-vm 26.55% <ø> (ø)
plugins-winston 31.60% <ø> (-0.09%) ⬇️
plugins-ws 38.92% <ø> (-0.09%) ⬇️
profiling-macos 37.94% <ø> (-0.55%) ⬇️
profiling-ubuntu 38.10% <ø> (-0.09%) ⬇️
profiling-windows 39.47% <ø> (-0.09%) ⬇️
serverless-azure-functions-client 25.75% <ø> (ø)
serverless-azure-functions-eventhubs 25.75% <ø> (ø)
serverless-azure-functions-servicebus 25.75% <ø> (ø)

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.

@juan-fernandez juan-fernandez enabled auto-merge (squash) April 10, 2026 08:57
@juan-fernandez juan-fernandez merged commit 8f81db6 into master Apr 10, 2026
892 of 894 checks passed
@juan-fernandez juan-fernandez deleted the juan-fernandez/fix-atf-is-new-other-frameworks branch April 10, 2026 09:04
dd-octo-sts bot pushed a commit that referenced this pull request Apr 10, 2026
@dd-octo-sts dd-octo-sts bot mentioned this pull request Apr 10, 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