Skip to content

refactor(bundler-tests): split webpack tests into webpack-4 and webpack-5#6098

Merged
pichlermarc merged 5 commits intoopen-telemetry:mainfrom
embrace-io:overbalance/add-webpack-4-bundler-test
Nov 13, 2025
Merged

refactor(bundler-tests): split webpack tests into webpack-4 and webpack-5#6098
pichlermarc merged 5 commits intoopen-telemetry:mainfrom
embrace-io:overbalance/add-webpack-4-bundler-test

Conversation

@overbalance
Copy link
Copy Markdown
Contributor

@overbalance overbalance commented Nov 10, 2025

Which problem is this PR solving?

The existing webpack bundler test only tested webpack 5. This PR adds webpack 4 testing to ensure compatibility with both major versions of webpack.

Changes

  • Split bundler-tests/browser/webpack/ into separate webpack-4/ and webpack-5/ directories
  • Added webpack 4 test configuration with babel-loader for transpilation (required for webpack 4 compatibility with ES modules)
  • Updated webpack 5 test configuration to use HTML webpack plugin
  • Added nx project configuration for both webpack tests
  • Simplified webpack test configurations (removed @opentelemetry scope from package names, updated descriptions)
  • Updated .gitignore to exclude dist/ directories
  • Removed webpack workspace from root package.json (bundler tests are not workspaces)
  • Added CHANGELOG entry

Type of change

  • Test improvement (adds test coverage for webpack 4)

@overbalance overbalance requested a review from a team as a code owner November 10, 2025 16:55
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.16%. Comparing base (ded89b5) to head (3f68257).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6098   +/-   ##
=======================================
  Coverage   95.16%   95.16%           
=======================================
  Files         316      316           
  Lines        9220     9220           
  Branches     2080     2080           
=======================================
  Hits         8774     8774           
  Misses        446      446           
🚀 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.

Comment thread bundler-tests/browser/webpack-5/package.json
@overbalance overbalance marked this pull request as draft November 10, 2025 17:08
@overbalance overbalance force-pushed the overbalance/add-webpack-4-bundler-test branch from a99e3c5 to c738d2e Compare November 10, 2025 17:35
@overbalance overbalance marked this pull request as ready for review November 10, 2025 17:36
@overbalance overbalance force-pushed the overbalance/add-webpack-4-bundler-test branch from c738d2e to a7eb83b Compare November 11, 2025 04:33
Comment thread bundler-tests/browser/webpack-4/webpack.config.mjs Outdated
Comment thread package.json
"examples/http",
"examples/https",
"examples/esm-http-ts",
"bundler-tests/browser/*"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Bundler test packages are not workspaces because npm is unable to install two versions of webpack.

Copy link
Copy Markdown
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Hmm - maybe I'm misunderstanding - but it looks to me that this now tests whatever is on npmjs.com rather than testing what we have locally. With this change we would only realize something's wrong after publishing to npmjs.com, right?

@overbalance overbalance force-pushed the overbalance/add-webpack-4-bundler-test branch from 9e31484 to 3f68257 Compare November 12, 2025 17:15
@overbalance
Copy link
Copy Markdown
Contributor Author

... now tests whatever is on npmjs.com rather than testing what we have locally. With this change we would only realize something's wrong after publishing to npmjs.com, right?

@pichlermarc I've used this pattern before but forgot to use relative links after removing the workspace entries. Great catch, thank you

Copy link
Copy Markdown
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

thanks! looks good :)

@pichlermarc pichlermarc added this pull request to the merge queue Nov 13, 2025
Merged via the queue into open-telemetry:main with commit 823251f Nov 13, 2025
27 checks passed
@overbalance overbalance deleted the overbalance/add-webpack-4-bundler-test branch November 14, 2025 00:48
@otelbot-js otelbot-js bot mentioned this pull request Jan 7, 2026
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.

2 participants