Skip to content

Support engine selection for Playwright Check Suites [RED-428]#1319

Merged
sorccu merged 13 commits into
mainfrom
simo/red-428-support-custom-nodejs-versions-in-playwright-check-suites
May 27, 2026
Merged

Support engine selection for Playwright Check Suites [RED-428]#1319
sorccu merged 13 commits into
mainfrom
simo/red-428-support-custom-nodejs-versions-in-playwright-check-suites

Conversation

@sorccu
Copy link
Copy Markdown
Member

@sorccu sorccu commented May 25, 2026

Summary

Adds support for selecting the JavaScript engine (Node.js or Bun) and version for Playwright Check Suites, with manual configuration, automatic detection, and rule-based version resolution.

Manual selection

import { PlaywrightCheck, Engine } from 'checkly/constructs'

new PlaywrightCheck('login-test', {
  name: 'Login E2E',
  playwrightConfigPath: './playwright.config.ts',
  engine: Engine.node('24'),  // or Engine.bun('1.3')
})

Automatic detection

When engine is not set, auto-detects from project version files (in priority order):

  1. .node-version
  2. .nvmrc (skips lts aliases)
  3. .tool-versions (nodejs / bun entries)
  4. .bun-version
  5. package.json engines.node / engines.bun (semver range via minVersion)

Version resolution

Both auto-detected and explicit versions are resolved through inlined engines.json rules:

  • EOL versions are remapped with a SubstitutedPropertyValueDiagnostic warning (e.g., Node 18 → 22)
  • Denied versions produce an InvalidPropertyValueDiagnostic error (e.g., Bun 2.x)
  • Valid versions pass through without diagnostics
  • The rules loader has an async signature to support future API-based rule loading

Changes

  • Engine classEngine.node() / Engine.bun() static factories with autocomplete hints for known versions
  • Version resolutionengine-resolver.ts with semver range matching, follow chains, deny actions
  • Rules loaderengine-rules-loader.ts with inlined rules (canonical source: monorepo/engines.json)
  • Auto-detectionengine-detector.ts with rule resolution, cached per session
  • DiagnosticsSubstitutedPropertyValueDiagnostic for remapped versions, InvalidPropertyValueDiagnostic for denied
  • synthesize — only includes engine/engineVersion fields when set (omitted → backend defaults to null)

Depends on

  • Monorepo: checkly/monorepo#1817 (merged)

Test plan

  • 15 unit tests for engine resolver (rule matching, follow chains, deny, all versions)
  • 3 sandbox integration tests (EOL warning, denied error, valid pass)
  • All 972 existing tests pass

sorccu added 12 commits May 25, 2026 04:50
Adds Engine.node('24') and Engine.bun('1.3') static factory methods
for selecting the JavaScript runtime engine. Also accepts plain
{ name, version } objects in checkly.config.ts.

Omitting the engine property sends null to the backend (auto-detect).
Detects the JavaScript engine from .node-version, .nvmrc,
.tool-versions, .bun-version, or package.json engines field.
No hardcoded version list — extracted versions are passed through
to the backend, which validates them.

Detection is cached per session via a shared promise on Session,
so concurrent bundle() calls only read version files once.
Resolves detected and explicit engine versions through semver-based
rules. EOL/unavailable versions are remapped with WarningDiagnostic
notices. Denied versions (e.g. Bun 2.x) clear the engine selection.

Rules are inlined as TypeScript constants (canonical source:
monorepo/engines.json). The loader has an async signature to support
future API-based rule loading.
Uses a dedicated diagnostic class for substituted property values.
Auto-detected substitutions include a hint about version files and
how to override with explicit Engine.node() / Engine.bun().
When a version is denied (e.g. Bun 2.0), the notices were silently
discarded because resolveNode/resolveBun returned undefined. Now
denied results propagate notices so warnings are shown to the user.
Denied versions (e.g. Bun 2.x) now produce an error diagnostic
instead of a warning, while substituted versions (e.g. Node 18 → 22)
remain as warnings.
Unit tests (15): verify all rule matching, follow chains, remapping,
and deny behavior for both Node and Bun.

Sandbox integration tests (3): verify engine diagnostics flow
end-to-end through parse-project — EOL warning, denied error,
and clean pass for valid versions.
@sorccu sorccu marked this pull request as draft May 27, 2026 05:26
@sorccu sorccu marked this pull request as ready for review May 27, 2026 05:26
@sorccu sorccu merged commit a5509e5 into main May 27, 2026
8 checks passed
@sorccu sorccu deleted the simo/red-428-support-custom-nodejs-versions-in-playwright-check-suites branch May 27, 2026 05:36
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