Skip to content

test: make the TypeScript and Rust client-gen tests run on Windows - #233

Merged
timesler merged 1 commit into
atlassian-labs:mainfrom
fenxcustom:fix/windows-test-portability
Jun 19, 2026
Merged

test: make the TypeScript and Rust client-gen tests run on Windows#233
timesler merged 1 commit into
atlassian-labs:mainfrom
fenxcustom:fix/windows-test-portability

Conversation

@mikeasick-fennec

Copy link
Copy Markdown
Contributor

What was broken

The TypeScript vitest suite and two Rust client_gen::python tests assumed a Unix
host (python3, / separators, :/$PATH, a single generated artifact, LF line
endings) and failed on Windows. #231 fixed the generated client and the Rust and
Python suites; these tests were the remaining Unix-only spot.

What this changes

Test-only, and no change on Unix.

  • client_gen::python: compile the generated module with the PYTHON interpreter,
    not a literal python3. Unset PYTHON still means python3.
  • On Windows, expect both generated files (the shell script and the .cmd), select
    the .cmd, and use ;/%PATH%; other platforms keep the single script and
    :/$PATH.
  • Build paths with join/dirname so they use the OS separator instead of a
    literal /.
  • Run the generated .cmd through a shell (Node can't run it directly).
  • Normalize CRLF before comparing snapshots.

Checked

  • Windows, .cmd via cmd.exe (local): vitest 91/91 and cargo --lib 230/0 (incl.
    the two client_gen::python tests); the generated client dispatches --help and
    rejects an unknown subcommand.
  • Windows, sh script via a POSIX shell (local): the same client's sh launcher
    dispatches identically (python3 pointed at a real interpreter for the run, since
    this box ships only the Store stub).
  • Unix, sh script (CI): ubuntu CI on this PR exercises the native Linux path.

Generated with Claude

The TypeScript vitest suite and two Rust `client_gen::python` tests assumed a
Unix host and failed on Windows. atlassian-labs#231 made the generated CLI client work on
Windows and fixed the Rust and Python suites; this covers the tests those left
untouched. Test-only, and no change on Unix.

- `client_gen::python`: compile the generated module with the `PYTHON`
  interpreter, not a literal `python3`. Unset `PYTHON` still means `python3`.
- On Windows, expect both generated files (the shell script and the `.cmd`),
  select the `.cmd`, use `;`/`%PATH%`, run the `.cmd` through a shell, and
  normalize CRLF before comparing snapshots. Build paths with `join`/`dirname`
  so they use the OS separator. Other platforms keep the old values.

Generated with Claude
@timesler
timesler merged commit c7ed8f1 into atlassian-labs:main Jun 19, 2026
13 checks passed
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