Skip to content

fix: run the test suite and the schema generator on Windows - #14

Merged
loxilb-devel merged 3 commits into
mainfrom
fix/windows-tests
Nov 16, 2026
Merged

loxilb-devel merged 3 commits into
mainfrom
fix/windows-tests

Conversation

@kp-attlab

Copy link
Copy Markdown
Collaborator

Description

Makes bun test pass and scripts/generate-schemas.ts run on Windows, so contributors there can pass the checks in CONTRIBUTING.md and regenerate the schemas as docs/developer-guide.md describes.

  • tests/config.test.ts: the expected audit log path is built with path.join instead of a hard-coded POSIX separator.
  • tests/log.test.ts: LOXILB_LOG_PATH is unset with delete. On Windows, and on Linux since Bun 1.4.0, assigning undefined stores the string "undefined", which resolveLogPath then returns. The EACCES case is skipped on win32, where chmod 0o000 does not block reads.
  • scripts/generate-schemas.ts: the project root comes from fileURLToPath(import.meta.url). new URL(import.meta.url).pathname gives /C:/... on Windows, so the generator looked for swagger_new.yml under \C:\... and exited. The pathname also keeps percent-escapes, so a checkout path containing a space failed as well.

Type of change

  • Bug fix
  • New feature / enhancement
  • Documentation
  • CI / build / packaging / tooling
  • Refactor (no functional change)

How has this been tested?

  • bun run lint, bun run typecheck and bun test pass
  • Manually exercised against a LoxiLB instance (version: )

Windows 11, Bun 1.4.4:

  • main: 4 tests fail (the audit log path, the two LOXILB_LOG_PATH cases and EACCES), and the generator exits with swagger_new.yml not found at \C:\....
  • This PR: 555 pass, 0 fail (EACCES skipped). The generator reproduces the committed schemas byte for byte.

Linux, Bun 1.4.4:

  • main: the two LOXILB_LOG_PATH cases fail.
  • This PR: 556 pass, 0 fail.

Linux, Bun 1.3.6 (the CI version): 556 pass, 0 fail. Line coverage 61.42% (floor 60%), no schema drift, linux-x64 build and smoke test pass, scripts/release-hygiene.sh (full history, with gitleaks) passes.

Dependency Audit still fails on the unchanged bun.lock, as noted in #7.

Checklist

  • My commits are DCO signed-off (git commit -s)
  • I have not committed secrets, real infrastructure inventories, or credentials
  • No internal/planning references in comments or docs
  • Docs / CHANGELOG updated where relevant
  • A code owner (see .github/CODEOWNERS) has been requested for review

Related issues

Follows #7.

- config: build the expected audit log path with path.join instead of
  a hard-coded POSIX separator.
- log: unset LOXILB_LOG_PATH with delete. On Windows, and on Linux
  since Bun 1.4.0, assigning undefined stores the string "undefined",
  which resolveLogPath then returns.
- log: skip the EACCES case on win32, where chmod 0o000 does not block
  reads.

Signed-off-by: KP <kp@attlab.org>
new URL(import.meta.url).pathname yields "/C:/..." on Windows, so the
generator looked for swagger_new.yml under "\C:\..." and exited. The
pathname also keeps percent-escapes, so a checkout path containing a
space failed as well. fileURLToPath returns a decoded native path on
every platform; regenerating from the unchanged spec reproduces the
committed schemas byte for byte.

Signed-off-by: KP <kp@attlab.org>
@loxilb-devel
loxilb-devel merged commit b0b54fb into main Nov 16, 2026
12 of 13 checks passed
@loxilb-devel
loxilb-devel deleted the fix/windows-tests branch November 16, 2026 01:45
@kp-attlab kp-attlab mentioned this pull request Nov 17, 2026
10 of 12 tasks
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