Skip to content

fix(ci): pin Node 24 for the unit test job and restore the launcher URL tests - #737

Merged
cevheri merged 1 commit into
mainfrom
ci/pin-node-unit-tests
Sep 9, 2026
Merged

fix(ci): pin Node 24 for the unit test job and restore the launcher URL tests#737
cevheri merged 1 commit into
mainfrom
ci/pin-node-unit-tests

Conversation

@cevheri

@cevheri cevheri commented Sep 9, 2026

Copy link
Copy Markdown
Member

Why

The Unit & Integration Tests job installs Bun but never pins Node. Anything in the suite that spawns node therefore runs on the ubuntu-24.04 image default, currently 22.x, while the launcher's own floor is Node 24 (assessNodeRuntime in bin/lib/launcher-utils.mjs). The launcher refuses and the case dies on a bare exit 1 in about 40ms.

That is exactly why #709 shipped without its three subprocess cases. The tests were right and the job was wrong, so the fix belongs here rather than in a contributor's PR.

What changed

  • .github/workflows/ci.yml: pin actions/setup-node to Node 24 in that job, matching engine-payload in the same file.
  • tests/unit/launcher-utils.test.ts: restore the three launcher startup URL cases from fix(cli): print usable startup URLs for wildcard and IPv6 hosts #709, credited in a comment to their author. They cover what the 12 pure startupUrl cases cannot, that bin/studio.js passes the real HOSTNAME and PORT through the helper and leaves the bind address alone.
  • The restored cases ask assessNodeRuntime about the ambient node before spawning, so a machine below the floor fails with the launcher's own sentence rather than an unexplained exit code. The floor is read from the product, not repeated here.

Measured

Both arms, locally:

  • PATH pointing at Node 22.15.1: 99 pass, 3 fail, each naming LibreDB Studio requires Node.js 24.0 or newer; this is Node 22.15.1. This is the state CI is in today.
  • Node 24.14.0: 102 pass, 0 fail.

Non-vacuity: replacing startupUrl(env.HOSTNAME, env.PORT) in bin/studio.js with the old http://${env.HOSTNAME}:${env.PORT} template fails all three restored cases.

Blast radius of the pin: tests/unit/launcher-utils.test.ts is the only file in the suite that spawns the ambient node. The two other subprocess tests use process.execPath, which is Bun.

Gates run locally: format, lint, typecheck, knip, chart:check, channels:showcase:check, readme:check, security:check, and the full bun run test.

…RL tests

The `Unit & Integration Tests` job installs Bun but never pins Node, so a test
that spawns `bin/studio.js` gets whatever the runner image ships, currently
22.x. The launcher's own floor is Node 24, so it refuses and the case dies on a
bare exit 1 in about 40ms. That is why #709 had to drop its three subprocess
cases to go green, and the gap was ours rather than the contributor's.

Pin the product's baseline in that job and bring the three cases back, written
by mikevillari in #709. They assert what a pure case table cannot: that
studio.js passes the real HOSTNAME and PORT through startupUrl and leaves the
bind address alone. Replacing the call with the old template literal fails all
three.

The cases now ask the launcher's own assessNodeRuntime about the ambient node
before spawning, so a machine below the floor fails with that sentence instead
of an unexplained exit code. `tests/unit/launcher-utils.test.ts` is the only
place in the suite that spawns the ambient node; everything else uses
process.execPath, which is Bun.

Measured both arms locally: with Node 22.15.1 on PATH the three cases fail and
name the reason; with Node 24.14.0 the file is 102 pass / 0 fail.
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@cevheri

cevheri commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

Hi @mikevillari
(just FYI: your followup PR)

@cevheri
cevheri merged commit e33e006 into main Sep 9, 2026
24 checks passed
@cevheri
cevheri deleted the ci/pin-node-unit-tests branch September 9, 2026 16:14
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.

1 participant