Skip to content

ci: simplify test scripts and separate coverage from test runs#2566

Open
WilliamBergamin wants to merge 8 commits intomainfrom
simplify-ci-testing
Open

ci: simplify test scripts and separate coverage from test runs#2566
WilliamBergamin wants to merge 8 commits intomainfrom
simplify-ci-testing

Conversation

@WilliamBergamin
Copy link
Copy Markdown
Contributor

Summary

  • Separated test coverage from regular test runs each package now has a test script and a test:coverage script. Previously most packages aliased test to test:unit which always included coverage instrumentation.
  • Removed the test:node18 scripts these were workarounds for Node 18 lacking --test-reporter support.
  • Simplified CI workflow replaced the split Run tests (Node 18/20) / Run tests (Node 22+) steps with a single Run tests step for most matrix entries, plus a Run test coverage step only on the latest supported Node version.
  • Added glob-bin as a root devDependency to replace bash -O globstar glob expansion in test scripts (cross-platform compatibility on Windows CI).

Requirements

@WilliamBergamin WilliamBergamin self-assigned this Apr 29, 2026
@WilliamBergamin WilliamBergamin requested a review from a team as a code owner April 29, 2026 19:57
@WilliamBergamin WilliamBergamin added semver:patch enhancement M-T: A feature request for new functionality github_actions Pull requests that update GitHub Actions code labels Apr 29, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: af3165f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.41%. Comparing base (62c5a3f) to head (af3165f).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2566   +/-   ##
=======================================
  Coverage   87.41%   87.41%           
=======================================
  Files          62       62           
  Lines       10251    10251           
  Branches      415      415           
=======================================
  Hits         8961     8961           
  Misses       1269     1269           
  Partials       21       21           
Flag Coverage Δ
cli-hooks 87.41% <ø> (ø)
cli-test 87.41% <ø> (ø)
logger 87.41% <ø> (ø)
oauth 87.41% <ø> (ø)
socket-mode 87.41% <ø> (ø)
web-api 87.41% <ø> (ø)
webhook 87.41% <ø> (ø)

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WilliamBergamin WilliamBergamin requested a review from zimeg April 29, 2026 21:51
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

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

@WilliamBergamin Amazing improvements to CI health! I like the pattern of checking coverage for the latest version so much 🧪 ✨

I'm approving with a few notes and question about dependencies noted? If this all seems expected please do merge:

Added glob-bin as a root devDependency to replace bash -O globstar glob expansion in test scripts (cross-platform compatibility on Windows CI).

I added af3165f during review that hinted toward this package, but was this still used?

🚢 💨

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.

🔭 note: I'm so curious for what happens to this file in upcoming releases!

pull_request:

env:
LATEST_SUPPORTED_NODE: "24.x"
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.

🧠 praise: Super nice to surface this clear!

@@ -64,15 +67,14 @@ jobs:
run: npm run lint
- name: Build docs
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.

Suggested change
- name: Build docs
- name: Build docs
if: matrix.node-version == env.LATEST_SUPPORTED_NODE

⌛ thought: We can save ~20 seconds for most runs with this? But perhaps it's adjacent to this PR!

"test": "npm run test:unit",
"test:node18": "bash -c 'node --test --test-reporter=spec src/*.test.js'",
"test:unit": "node --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=test-results.xml --test src/*.test.js"
"test": "bash -c 'node --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --test src/*.test.js'",
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.

Suggested change
"test": "bash -c 'node --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --test src/*.test.js'",
"test": "bash -c 'node --test src/*.test.js'",

🧪 thought(non-blocking): I like the pattern of a minimal test script and a more complex test:coverage but am uncertain which flags remain needed for the first?

Comment on lines 227 to +228
npm test --workspace=packages/web-api # all tests
npm run test:unit --workspace=packages/web-api # unit only
npm test --workspace=packages/web-api # unit only
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.

🔭 thought: One of these might be good to remove since it's unclear which test suite is used at a glance?

Comment thread package.json
"lint": "npx @biomejs/biome check packages",
"lint:fix": "npx @biomejs/biome check --write packages",
"test": "npm test --workspaces --if-present",
"test:coverage": "npm run test:coverage --workspaces --if-present",
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.

🏆 praise: These patterns are joined well here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality github_actions Pull requests that update GitHub Actions code semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants