Skip to content

test(appsec): consolidate Express setup and teardown - #9875

Merged
BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-08-19-eslint-appsec-express-lifecycle
Aug 20, 2026
Merged

BridgeAR merged 3 commits into
masterfrom
BridgeAR/2026-08-19-eslint-appsec-express-lifecycle

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

What does this PR do?

Runs Express AppSec fixture setup and teardown through one ordered hook per phase.

Motivation

Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.

Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.
@dd-octo-sts

dd-octo-sts Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.25 MB
Deduped: 8.92 MB
No deduping: 8.92 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 445.14 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 Aug 19, 2026 •

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 98.55% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b7b8064 | Docs | View more details | Give us feedback!

@codecov

codecov Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (7b599e3) to head (b7b8064).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9875      +/-   ##
==========================================
- Coverage   98.54%   97.83%   -0.72%     
==========================================
  Files         982      977       -5     
  Lines      145106   144954     -152     
  Branches    12799    12239     -560     
==========================================
- Hits       143000   141811    -1189     
- Misses       2106     3143    +1037     
Flag Coverage Δ
aiguard 57.11% <ø> (-0.08%) ⬇️
aiguard-integration 55.20% <ø> (-0.05%) ⬇️
apm-bucket-0 57.32% <ø> (-0.04%) ⬇️
apm-bucket-1 62.44% <ø> (-0.08%) ⬇️
apm-bucket-2 61.26% <ø> (-0.08%) ⬇️
apm-bucket-3 58.92% <ø> (-0.08%) ⬇️
apm-capabilities-tracing 62.16% <ø> (-0.03%) ⬇️
apm-integrations-aerospike 55.00% <ø> (-0.08%) ⬇️
apm-integrations-confluentinc-kafka-javascript 60.22% <ø> (-0.11%) ⬇️
apm-integrations-couchbase 55.88% <ø> (-0.08%) ⬇️
apm-integrations-http 61.05% <ø> (-0.05%) ⬇️
apm-integrations-kafkajs 60.76% <ø> (-0.08%) ⬇️
apm-integrations-next 58.54% <ø> (-0.08%) ⬇️
apm-integrations-prisma 58.01% <ø> (-0.07%) ⬇️
appsec 71.23% <ø> (+0.01%) ⬆️
appsec-express_fastify_graphql 68.58% <ø> (-0.05%) ⬇️
appsec-integration 49.59% <ø> (+0.07%) ⬆️
appsec-kafka_ldapjs_lodash 62.53% <ø> (-0.08%) ⬇️
appsec-mongodb-core_mongoose_mysql 66.04% <ø> (-0.05%) ⬇️
appsec-next 55.99% <ø> (-0.05%) ⬇️
appsec-node-serialize_passport_postgres 65.45% <ø> (-0.05%) ⬇️
appsec-sourcing_stripe_template 63.89% <ø> (-0.05%) ⬇️
debugger 63.30% <ø> (-0.07%) ⬇️
instrumentations-bucket-0 50.96% <ø> (-0.07%) ⬇️
instrumentations-bucket-1 58.78% <ø> (-0.08%) ⬇️
instrumentations-bucket-10 60.07% <ø> (-0.05%) ⬇️
instrumentations-bucket-11 60.73% <ø> (-0.05%) ⬇️
instrumentations-bucket-12 50.87% <ø> (-0.07%) ⬇️
instrumentations-bucket-13 51.72% <ø> (-0.07%) ⬇️
instrumentations-bucket-14 50.97% <ø> (-0.07%) ⬇️
instrumentations-bucket-2 52.21% <ø> (-0.07%) ⬇️
instrumentations-bucket-3 52.84% <ø> (-0.07%) ⬇️
instrumentations-bucket-4 57.88% <ø> (-0.08%) ⬇️
instrumentations-bucket-5 48.60% <ø> (-0.06%) ⬇️
instrumentations-bucket-6 59.37% <ø> (-0.08%) ⬇️
instrumentations-bucket-7 51.16% <ø> (-0.07%) ⬇️
instrumentations-bucket-8 57.59% <ø> (-0.08%) ⬇️
instrumentations-bucket-9 56.44% <ø> (-0.08%) ⬇️
instrumentations-instrumentation-couchbase 49.74% <ø> (-0.07%) ⬇️
instrumentations-integration-esbuild 33.87% <ø> (ø)
llmobs-ai_anthropic_bedrock 62.02% <ø> (-0.07%) ⬇️
llmobs-bucket-1 60.56% <ø> (-0.07%) ⬇️
llmobs-openai 61.22% <ø> (-0.07%) ⬇️
llmobs-openai-agents_vertex-ai 59.28% <ø> (-0.06%) ⬇️
llmobs-sdk 67.48% <ø> (-0.09%) ⬇️
master-coverage 97.83% <ø> (?)
openfeature 55.22% <ø> (-0.05%) ⬇️
openfeature-unit 53.15% <ø> (-0.07%) ⬇️
platform-core_esbuild_instrumentations-misc 40.77% <ø> (-0.03%) ⬇️
platform-integration 59.60% <ø> (-0.05%) ⬇️
platform-shimmer_unit-guardrails_webpack 38.43% <ø> (-0.03%) ⬇️
plugins-browser-bunyan_bullmq_cassandra 60.65% <ø> (-0.08%) ⬇️
plugins-bucket-0 56.13% <ø> (-0.07%) ⬇️
plugins-bucket-1 53.25% <ø> (-0.05%) ⬇️
plugins-bucket-11 61.05% <ø> (-0.07%) ⬇️
plugins-bucket-18 60.61% <ø> (-0.07%) ⬇️
plugins-bucket-19 58.83% <ø> (-0.08%) ⬇️
plugins-bucket-20 60.75% <ø> (-0.08%) ⬇️
plugins-bucket-4 55.49% <ø> (-0.08%) ⬇️
plugins-cookie_cookie-parser_crypto 50.49% <ø> (-0.07%) ⬇️
plugins-fastify_fetch_fs 59.72% <ø> (-0.05%) ⬇️
plugins-generic-pool_google-cloud-pubsub_grpc 63.21% <ø> (-0.08%) ⬇️
plugins-handlebars_hapi_hono 57.71% <ø> (-0.08%) ⬇️
plugins-ioredis_knex_langgraph 56.18% <ø> (-0.08%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 57.41% <ø> (-0.07%) ⬇️
plugins-lodash_mariadb_memcached 57.11% <ø> (-0.08%) ⬇️
plugins-moleculer_mongodb_mongodb-core 60.53% <ø> (-0.08%) ⬇️
plugins-mongoose_multer_mysql 58.39% <ø> (-0.08%) ⬇️
plugins-mysql2_nats_node-serialize 59.99% <ø> (-0.08%) ⬇️
plugins-opensearch_passport-http_pino 58.26% <ø> (-0.08%) ⬇️
plugins-postgres_process_pug 57.45% <ø> (-0.04%) ⬇️
plugins-redis_router_sequelize 60.60% <ø> (-0.08%) ⬇️
plugins-test-and-upstream-rhea_undici_url 60.20% <ø> (-0.08%) ⬇️
plugins-valkey_vm_winston 56.85% <ø> (-0.04%) ⬇️
plugins-ws 58.38% <ø> (-0.08%) ⬇️
profiling 60.86% <ø> (-0.08%) ⬇️
serverless-aws-sdk-aws-sdk 54.14% <ø> (-0.06%) ⬇️
serverless-aws-sdk-base-inject-field 50.20% <ø> (-0.07%) ⬇️
serverless-aws-sdk-bedrockruntime 53.91% <ø> (-0.07%) ⬇️
serverless-aws-sdk-client 55.40% <ø> (-0.07%) ⬇️
serverless-aws-sdk-dynamodb 54.72% <ø> (-0.07%) ⬇️
serverless-aws-sdk-eventbridge 56.21% <ø> (-0.07%) ⬇️
serverless-aws-sdk-kinesis 58.22% <ø> (-0.07%) ⬇️
serverless-aws-sdk-lambda ?
serverless-aws-sdk-s3 54.82% <ø> (-0.07%) ⬇️
serverless-aws-sdk-serverless-peer-service 58.79% <ø> (-0.07%) ⬇️
serverless-aws-sdk-sns ?
serverless-aws-sdk-sqs 59.42% <ø> (-0.07%) ⬇️
serverless-aws-sdk-stepfunctions 54.65% <ø> (-0.07%) ⬇️
serverless-aws-sdk-util ?
serverless-bucket-0 52.87% <ø> (-0.05%) ⬇️
serverless-bucket-1 ?
test-optimization-cucumber ?
test-optimization-cypress 64.49% <ø> (+0.04%) ⬆️
test-optimization-jest 71.67% <ø> (-0.17%) ⬇️
test-optimization-mocha 71.73% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-atr 59.37% <ø> (+0.03%) ⬆️
test-optimization-playwright-playwright-efd ?
test-optimization-playwright-playwright-final-status 59.61% <ø> (-0.04%) ⬇️
test-optimization-playwright-playwright-impacted-tests 59.17% <ø> (+0.11%) ⬆️
test-optimization-playwright-playwright-reporting 60.70% <ø> (-0.01%) ⬇️
test-optimization-playwright-playwright-test-management 60.09% <ø> (-0.13%) ⬇️
test-optimization-playwright-playwright-test-span 59.34% <ø> (-0.10%) ⬇️
test-optimization-selenium 58.58% <ø> (-0.16%) ⬇️
test-optimization-testopt 57.24% <ø> (+0.03%) ⬆️
test-optimization-vitest 72.41% <ø> (+<0.01%) ⬆️
test-optimization-vitest-browser 58.42% <ø> (-0.03%) ⬇️
test-optimization-webdriverio 64.61% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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.

@BridgeAR
BridgeAR marked this pull request as ready for review August 19, 2026 15:12
@BridgeAR
BridgeAR requested a review from a team as a code owner August 19, 2026 15:12

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 258bc609e8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@pr-commenter

pr-commenter Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-20 11:57:42

Comparing candidate commit b7b8064 in PR branch BridgeAR/2026-08-19-eslint-appsec-express-lifecycle with baseline commit 7b599e3 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2282 metrics, 10 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 ----------------------------------'

Unstable benchmarks

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

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-16.719MB; +22.515MB] or [-4.402%; +5.928%]

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

  • unstable max_rss_usage [-12.723MB; +15.880MB] or [-5.090%; +6.353%]

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

  • unstable max_rss_usage [-14791.416KB; +15181.016KB] or [-5.225%; +5.362%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-322.973ms; +414.864ms] or [-6.662%; +8.557%]
  • unstable execution_time [-327.737ms; +421.346ms] or [-6.665%; +8.568%]
  • unstable throughput [-149701.299op/s; +117564.730op/s] or [-8.751%; +6.873%]

scenario:llmobs-encode-unicode-mixed-20

  • unstable max_rss_usage [-7.521MB; +11.006MB] or [-10.062%; +14.726%]

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

  • unstable max_rss_usage [-29.570MB; +21.653MB] or [-7.343%; +5.377%]

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

  • unstable max_rss_usage [-5.555MB; +11.723MB] or [-4.142%; +8.741%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-6.360MB; +2.870MB] or [-7.886%; +3.559%]

A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
@BridgeAR
BridgeAR merged commit a6a2164 into master Aug 20, 2026
682 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-08-19-eslint-appsec-express-lifecycle branch August 20, 2026 16:42
dd-octo-sts Bot pushed a commit that referenced this pull request Aug 21, 2026
* test(appsec): consolidate Express setup and teardown

Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.

* test(appsec): await server listening events

* test(appsec): protect cleanup from missing server

A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
This was referenced Aug 21, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Aug 21, 2026
* test(appsec): consolidate Express setup and teardown

Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.

* test(appsec): await server listening events

* test(appsec): protect cleanup from missing server

A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
pabloerhard pushed a commit that referenced this pull request Aug 21, 2026
* test(appsec): consolidate Express setup and teardown

Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.

* test(appsec): await server listening events

* test(appsec): protect cleanup from missing server

A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
pabloerhard pushed a commit that referenced this pull request Aug 21, 2026
* test(appsec): consolidate Express setup and teardown

Separate same-phase hooks made instrumentation loading, server startup, and cleanup depend on Mocha's registration sequence.

* test(appsec): await server listening events

* test(appsec): protect cleanup from missing server

A version-specific setup failure can leave server unset, so calling server.close() before the cleanup guard prevents appsec.disable() and contaminates later version suites. Guard server shutdown within the protected cleanup so AppSec is disabled even when setup never creates a server.
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