Skip to content

Add Linux installation E2E tests across package managers - #131

Open
fhammerschmidt wants to merge 19 commits into
rescript-lang:masterfrom
fhammerschmidt:test/linux-installation-e2e
Open

fhammerschmidt wants to merge 19 commits into
rescript-lang:masterfrom
fhammerschmidt:test/linux-installation-e2e

Conversation

@fhammerschmidt

@fhammerschmidt fhammerschmidt commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

The existing CI smoke test always creates one basic npm project through a special CI-only path. Add independent Ubuntu E2E jobs for npm, pnpm, Yarn Classic, Yarn Berry and Bun, using the packed CLI artifact and the normal interactive application paths.

Each manager creates a basic project and adds ReScript to an existing CommonJS project, both using the current ReScript 12 release and its bundled standard library. The npm job also covers existing ESM, NodeNext/bundler TypeScript with a compiled genType consumer, devcontainer-only named/current directories, and rejection of occupied directories without changing their files. Tests install real dependencies, verify lockfiles, compile ReScript and execute the generated program.

The harness and launcher are written in ReScript under test/e2e/ and reuse the production PackageManagers.packageManager type. E2E case labels and expected lockfiles remain test data. Update the development compiler and lockfile to ReScript 12.3.1 and enable LetUnwrap in rescript.json. Raw Node externals stay in src/bindings/Node.res; a small src/bindings/NodeSafe.res module adapts filesystem, process, child-process and URL operations to results/options. The command runner keeps its E2E-specific prompts, timeouts and assertions; command, file and test failures use polymorphic error variants with an exhaustive formatter. Setup and scenarios propagate failures with let?, without rethrowing Node errors. Command cleanup runs before propagation, callback log failures stop the child safely, and workspace cleanup preserves the original failure if cleanup also fails. Assertion exceptions are captured at the scenario boundary. Known environment keys and nested JSON shapes use dict{...} patterns. Nullable stdin and exit values use Value, Null and Undefined directly, with Nullable.getOr for defaults. The ESM entry point handles await main() directly with a result match, with no try/catch in its orchestration. Setup constructs its launcher JSON directly, and empty commands return a validation error. Exception capture stays at the I/O adapters and test assertion boundary.

Scenario parameters are mandatory, and typed command modes distinguish pipes from terminal prompts. E2eScenarios.res contains fixtures and assertions, while E2eProcess.res handles commands and prompts. npm run test:e2e compiles the harness through the existing test configuration. Ubuntu's util-linux script supplies the terminal, with no additional npm dependencies. Failed jobs upload logs, and release publishing waits for the E2E matrix.

AGENTS.md contains the ReScript conventions and the minimum E2E command/prerequisites; there is no separate E2E README.

Validation: all 52 regression tests pass, including ten focused tests for invalid commands, synchronous/asynchronous spawn errors, expected and unexpected exit statuses, signal termination, timeout cleanup, callback log failures and assertion capture. All five Ubuntu E2E jobs pass (17 cases) with Node 20.19.0. The build, Linux/Windows smoke jobs and both macOS smoke jobs also pass. Local entry-point checks also verify that context/setup failures return exit code 1 and remove the temporary workspace. ReScript formatting and production packing pass locally on Node 20.19.0; workflow lint passed for the workflow changes.

CI run

@pkg-pr-new

pkg-pr-new Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/create-rescript-app@131

commit: 88c7831

@fhammerschmidt
fhammerschmidt marked this pull request as ready for review October 12, 2026 20:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T20:58:40.783232Z 7dfe963 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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