Skip to content

chore(tests): enforce LF via .gitattributes and fix Windows test-harness portability - #19

Merged
thvtzy merged 2 commits into
masterfrom
chore/windows-test-portability
Nov 26, 2026
Merged

thvtzy merged 2 commits into
masterfrom
chore/windows-test-portability

Conversation

@thvtzy

@thvtzy thvtzy commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Summary

Enforce LF line endings across platforms via .gitattributes and fix Windows-only test-harness assumptions so the full test suite passes natively on Windows without manual environment workarounds or touching any product code.

Changes

  • .gitattributes: * text=auto eol=lf for text files plus binary for *.wasm, *.vsix, and *.bin so Windows clones keep exact checked-in LF byte masses (packages/bundles/ 267,156 B, registry/index.json 10,927 B, packages/npm/ 71,873 B) and SHA-256 catalog digests.
  • Test-harness portability (10 files under tests/):
    • phase121_bindings.rs: invoke npm.cmd and node_modules/.bin/tsc.cmd on Windows.
    • phase129_checker.rs, phase158_component_probes.rs: normalize \ to / when sorting and asserting relative repo paths.
    • phase156_vscode.rs, phase157_gate_merge.rs: use built-in tar (-tf / -xOf) on Windows to inspect .vsix archives where unzip is absent (Unix behavior unchanged).
    • phase158_component_probes.rs, phase159_component.rs, phase160_callbacks.rs, phase161_gate_merge.rs: fall back from HOME to USERPROFILE and append std::env::consts::EXE_SUFFIX for cargo/rustup.
    • phase166_gate.rs: fall back from sha256sum to morphic::registry::sha256_hex when sha256sum is not on PATH.
    • phase164_registry_verbs.rs, phase166_gate.rs: explicitly call stream.set_nonblocking(false) and stream.shutdown(Shutdown::Write) on accepted sockets in the in-test localhost HTTP servers (Winsock2 inherits nonblocking mode from the listener).
  • CHANGELOG.md: recorded the change under [Unreleased] in a separate docs commit.

Non-movers

  • Zero product code (src/), zero dependencies (Cargo.toml/Cargo.lock), zero version strings, and zero frozen scope documents touched.

Local verification (Windows, solo, without manual HOME)

  • cargo test: 981 passed / 0 failed / 29 ignored
  • cargo test --features bootstrap-codegen: 981 passed / 0 failed / 29 ignored
  • cargo test --no-default-features: 837 passed / 0 failed / 22 ignored

…ess portability

No product logic, dependencies, versions, or frozen scope documents touched.

- Add .gitattributes (* text=auto eol=lf; *.wasm, *.vsix, *.bin binary) so checkouts on Windows preserve exact LF byte masses and SHA-256 catalog digests.
- phase121_bindings: invoke npm.cmd and node_modules/.bin/tsc.cmd on Windows.
- phase129_checker, phase158_component_probes: normalize '\\' to '/' when sorting and checking relative repo paths.
- phase156_vscode, phase157_gate_merge: use Windows built-in tar (-tf / -xOf) to inspect .vsix archives when unzip is absent (Unix retains unzip).
- phase158..161: fall back from HOME to USERPROFILE and append EXE_SUFFIX for cargo/rustup.
- phase166_gate: fall back from sha256sum to morphic::registry::sha256_hex when sha256sum is not on PATH.
- phase164_registry_verbs, phase166_gate: call stream.set_nonblocking(false) and shutdown(Write) on accepted sockets (Winsock2 inherits nonblocking mode from the listener).

Verified solo across all three frozen configurations on Windows without manual HOME:
- default: 981 passed / 0 failed / 29 ignored
- --features bootstrap-codegen: 981 passed / 0 failed / 29 ignored
- --no-default-features: 837 passed / 0 failed / 22 ignored
@thvtzy
thvtzy merged commit 5166314 into master Nov 26, 2026
2 checks passed
@thvtzy
thvtzy deleted the chore/windows-test-portability branch November 26, 2026 09:15
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