Skip to content

test: migrate tap to mocha - #7135

Merged
watson merged 8 commits into
masterfrom
BridgeAR/2025-12-18-migrate-tap-to-mocha
Jan 7, 2026
Merged

test: migrate tap to mocha#7135
watson merged 8 commits into
masterfrom
BridgeAR/2025-12-18-migrate-tap-to-mocha

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

This tries to align with the former behavior as close as possible. This is for example the case by using more parallel threads, even if the CPU has less cores.

@github-actions

github-actions Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 4.37 MB
Deduped: 5.19 MB
No deduping: 5.19 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@codecov

codecov Bot commented Dec 18, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.51%. Comparing base (28b054c) to head (75b81bd).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7135      +/-   ##
==========================================
- Coverage   84.53%   84.51%   -0.02%     
==========================================
  Files         526      527       +1     
  Lines       22534    22538       +4     
==========================================
  Hits        19048    19048              
- Misses       3486     3490       +4     

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

@BridgeAR
BridgeAR force-pushed the BridgeAR/2025-12-18-migrate-tap-to-mocha branch from 59a8f70 to 6e5bb26 Compare December 19, 2025 21:23
@pr-commenter

pr-commenter Bot commented Dec 19, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-01-07 18:33:51

Comparing candidate commit 75b81bd in PR branch BridgeAR/2025-12-18-migrate-tap-to-mocha with baseline commit 28b054c in branch master.

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

@BridgeAR
BridgeAR force-pushed the BridgeAR/2025-12-18-migrate-tap-to-mocha branch from 475265f to 93fdaec Compare December 22, 2025 15:33
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Dec 22, 2025

Copy link
Copy Markdown

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 4 New flaky tests detected

tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation.test_consume[fastify] from system_tests_suite (Datadog) (Fix with Cursor)
assert None is not None

self = <tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation object at 0x7fcbf2dda780>

    def test_consume(self):
        """Check that a message by an app instrumented by a Datadog tracer is correctly ingested"""
    
        assert self.production_response.status_code == 200, self.production_response.text
        assert self.consume_response.status_code == 200, self.consume_response.text
    
...
tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation.test_consume_trace_equality[fastify] from system_tests_suite (Datadog) (Fix with Cursor)
assert None is not None

self = <tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation object at 0x7fcbf2dda210>

    @missing_feature(library="golang", reason="Expected to fail, Golang does not propagate context")
    @missing_feature(library="ruby", reason="Expected to fail, Ruby does not propagate context")
    def test_consume_trace_equality(self):
        """This test relies on the setup for consume, it currently cannot be run on its own"""
        producer_span = self.get_span(
            self.buddy_interface,
...
tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation.test_produce[fastify] from system_tests_suite (Datadog) (Fix with Cursor)
assert None is not None

self = <tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation object at 0x7fcbf2ddafc0>

    def test_produce(self):
        """Check that a message produced to RabbitMQ is correctly ingested by a Datadog tracer"""
    
        assert self.production_response.status_code == 200, self.production_response.text
        assert self.consume_response.status_code == 200, self.consume_response.text
    
...
tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation.test_produce_trace_equality[fastify] from system_tests_suite (Datadog) (Fix with Cursor)
assert None is not None

self = <tests.integrations.crossed_integrations.test_rabbitmq.Test_RabbitMQ_Trace_Context_Propagation object at 0x7fcbf2ddb3e0>

    @missing_feature(library="golang", reason="Expected to fail, Golang does not propagate context")
    @missing_feature(library="ruby", reason="Expected to fail, Ruby does not propagate context")
    def test_produce_trace_equality(self):
        """This test relies on the setup for produce, it currently cannot be run on its own"""
        producer_span = self.get_span(
            interfaces.library,
...
View all

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 75b81bd | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@BridgeAR
BridgeAR marked this pull request as ready for review December 22, 2025 17:51
@BridgeAR
BridgeAR requested review from a team as code owners December 22, 2025 17:51
@BridgeAR
BridgeAR requested review from khanayan123 and removed request for a team December 22, 2025 17:51
Comment thread scripts/mocha-parallel-files.js Outdated
tlhunter
tlhunter previously approved these changes Dec 22, 2025

@tlhunter tlhunter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As mentioned elsewhere my preference for test suites is:
all node:test > all tap > all mocha > tap + mocha

So I would consider this PR an improvement to what we have today even if it's not in the direction I would ultimately prefer.

Comment thread packages/dd-trace/test/encode/coverage-ci-visibility.spec.js Outdated
Comment thread packages/dd-trace/test/plugins/util/inferred_proxy.spec.js Outdated
Comment thread packages/dd-trace/test/azure_metadata.spec.js
Comment thread packages/dd-trace/test/custom-metrics.spec.js Outdated
Comment thread packages/dd-trace/test/runtime_metrics.spec.js Outdated
Comment thread packages/dd-trace/test/runtime_metrics.spec.js
Comment thread scripts/mocha-parallel-files.js
Comment thread packages/dd-trace/test/setup/mocha.js Outdated
Comment thread packages/dd-trace/test/setup/mocha.js
@watson

watson commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

Forgot to mention in my review that this PR should also update the .md files currently mentioning tap

watson
watson previously approved these changes Jan 6, 2026

@watson watson left a comment

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.

I've reviewed everything except the new scripts in scripts folder for running the mocha tests in parallel. I don't have the bandwith to review those now, but I think as long as we can verify that all the tests are running and that if a single test is failing, it fails the job, then I'm happy with this getting merged.

@watson
watson requested a review from a team January 6, 2026 15:21
This tries to align with the former behavior as close as possible.
This is for example the case by using more parallel threads, even
if the CPU has less cores.
This is adding a script to run multiple mocha test files in parallel
in their own child process instead of using mocha's own parallel
mode that is using a pool instead of child processes.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2025-12-18-migrate-tap-to-mocha branch from d3943c3 to 1ecd1d2 Compare January 6, 2026 16:51
@watson
watson enabled auto-merge (squash) January 7, 2026 18:23
@watson
watson merged commit 4a02492 into master Jan 7, 2026
1067 of 1068 checks passed
@watson
watson deleted the BridgeAR/2025-12-18-migrate-tap-to-mocha branch January 7, 2026 18:39
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jan 12, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Jan 12, 2026
* test: migrate tap to mocha

This tries to align with the former behavior as close as possible.
This is for example the case by using more parallel threads, even
if the CPU has less cores.

* test: run mocha tests in parallel per file

This is adding a script to run multiple mocha test files in parallel
in their own child process instead of using mocha's own parallel
mode that is using a pool instead of child processes.

---------

Co-authored-by: Thomas Watson <thomas.watson@datadoghq.com>
nina9753 pushed a commit that referenced this pull request Jan 15, 2026
* test: migrate tap to mocha

This tries to align with the former behavior as close as possible.
This is for example the case by using more parallel threads, even
if the CPU has less cores.

* test: run mocha tests in parallel per file

This is adding a script to run multiple mocha test files in parallel
in their own child process instead of using mocha's own parallel
mode that is using a pool instead of child processes.

---------

Co-authored-by: Thomas Watson <thomas.watson@datadoghq.com>
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