Skip to content

test: use partialDeepStrictEqual instead of individual assertions#7133

Merged
BridgeAR merged 2 commits intomasterfrom
BridgeAR/2025-12-18-test-improvements
Dec 18, 2025
Merged

test: use partialDeepStrictEqual instead of individual assertions#7133
BridgeAR merged 2 commits intomasterfrom
BridgeAR/2025-12-18-test-improvements

Conversation

@BridgeAR
Copy link
Copy Markdown
Member

This makes the test output in case of errors easier to understand as well as making the code easier to read.

The diff is big while it should be easy to review.

The code change was done with an AI, concentrating solely on this migration in files with most offenders.

This makes the test output in case of errors easier to understand
as well as making the code easier to read.
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.10%. Comparing base (8f86699) to head (f1a0543).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7133      +/-   ##
==========================================
- Coverage   84.79%   84.10%   -0.70%     
==========================================
  Files         521      514       -7     
  Lines       22159    21995     -164     
==========================================
- Hits        18790    18498     -292     
- Misses       3369     3497     +128     

☔ 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 17, 2025

Overall package size

Self size: 4.35 MB
Deduped: 5.24 MB
No deduping: 5.24 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 1.15.0 | 127.66 kB | 856.24 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Dec 17, 2025

Benchmarks

Benchmark execution time: 2025-12-18 01:57:32

Comparing candidate commit f1a0543 in PR branch BridgeAR/2025-12-18-test-improvements with baseline commit 8f86699 in branch master.

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

@BridgeAR BridgeAR marked this pull request as ready for review December 18, 2025 03:23
@BridgeAR BridgeAR requested review from a team as code owners December 18, 2025 03:23
@simon-id
Copy link
Copy Markdown
Member

simon-id commented Dec 18, 2025

@BridgeAR did you review yourself carefully every line of the diff to make sure the output of the AI is correct and functionally equivalent to the original ?

const envVar = { DD_TRACE_AZURE_EVENTHUBS_BATCH_LINKS_ENABLED: false, ...spawnEnv }
proc = await spawnPluginIntegrationTestProc(sandboxCwd(), 'server.mjs', agent.port, undefined, envVar)
const envVar = { DD_TRACE_AZURE_EVENTHUBS_BATCH_LINKS_ENABLED: 'false', ...spawnEnv }
proc = await spawnPluginIntegrationTestProc(sandboxCwd(), 'server.mjs', agent.port, envVar)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why did this work before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Envs are always converted to a string when being assigned. It is a magic setter.

undefined was fine due to the overloading happening in the method.

Comment on lines +652 to +654
assertObjectContains(traces[0][0].meta, {
'_dd.dbm_trace_injected': 'true'
})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: This one could be reverted. Maybe there's similar situations in the files above that I missed. Consider validating

@BridgeAR
Copy link
Copy Markdown
Member Author

@simon-id I quickly went through all changes and I could not identify any wrong change. That should also easily show up in test failures (besides lacking new entries)

@BridgeAR BridgeAR merged commit 8822838 into master Dec 18, 2025
793 checks passed
@BridgeAR BridgeAR deleted the BridgeAR/2025-12-18-test-improvements branch December 18, 2025 17:56
dd-octo-sts Bot pushed a commit that referenced this pull request Dec 19, 2025
)

This makes the test output in case of errors easier to understand
as well as making the code easier to read.
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Dec 19, 2025
nina9753 pushed a commit that referenced this pull request Dec 20, 2025
)

This makes the test output in case of errors easier to understand
as well as making the code easier to read.
nina9753 pushed a commit that referenced this pull request Jan 15, 2026
)

This makes the test output in case of errors easier to understand
as well as making the code easier to read.
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.

3 participants