Skip to content

fix(test): make container and store tests platform-aware on Windows - #451

Merged
jahvon merged 1 commit into
mainfrom
fix/windows-container-tests
Aug 27, 2026
Merged

fix(test): make container and store tests platform-aware on Windows#451
jahvon merged 1 commit into
mainfrom
fix/windows-container-tests

Conversation

@jahvon

@jahvon jahvon commented Aug 27, 2026

Copy link
Copy Markdown
Member

Unblocks the Windows check on #439. These failures are not from that PR — all four specs exist unchanged on main.

Summary

Four specs asserted Unix-only behavior and failed on Windows. They have been latent for a while: windows-ci only runs behind the test:windows label, and no PR had carried it since the code that introduced them. Labelling #439 ran them for the first time.

Spec Why it failed on Windows
expands and mounts workspace-relative and absolute volumes /opt/data is not absolute under filepath.IsAbs
expands volume host paths [absolute] same
writeEnvFile writes sorted 0600 entries mode read back as 0666
BoltDataStoreentire suite ERROR_INVALID_NAME in BeforeEach

Volume paths. expandVolumeHost gates on filepath.IsAbs, which rejects /opt/data on Windows — there an absolute path needs a drive letter. Two specs hardcoded it as the host side of a volume. They now build the host path for the platform. The container side stays Unix, since container paths are always Linux paths, and ExecContainerVolume.Parts already handles the drive-letter colon.

File mode. Go maps Unix permission bits onto ACLs on Windows, so 0600 is not expressible and reads back as 0666. The assertion is skipped there and still enforced everywhere it means something. The content assertion is unchanged.

Store suite. This one took out every spec in pkg/store, not just the offending one. The database filename was derived from the spec name:

path := filepath.Join(GinkgoT().TempDir(), fmt.Sprintf("test_%s.db", GinkgoT().Name()))

One spec is named ... (running -> terminal), and > is not a legal Windows filename character — so BeforeEach failed with ERROR_INVALID_NAME (0x7b). TempDir is already unique per spec, so the suffix bought nothing and is dropped.

Scope

Test-only. The production paths were already Windows-capable — Parts handles drive letters, and container paths are correctly validated with Unix semantics. This fixes assertions, not behavior.

Testing

Verified on real Windows runners via workflow_dispatch rather than inferred from GOOS reasoning:

  • Before: 3 failures (2 volume specs + writeEnvFile).
  • After the first fix: those cleared, exposing the store suite failure underneath — which had been masked by the earlier ones.
  • After both: all six Windows jobs green — unit, E2E, build, binary smoke, native script execution, validation.

Unix behavior is unchanged: go test -tags=unit ./internal/runner/exec/ ./internal/services/run/ ./pkg/store/ passes locally, and the affected specs still assert the same things on Unix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Four specs asserted Unix-only behavior and failed on Windows. All have been
latent for a while: windows-ci only runs behind the test:windows label, and no
PR had carried it since the code that introduced them.

expandVolumeHost gates on filepath.IsAbs, which rejects "/opt/data" on Windows
where an absolute path needs a drive letter. Two specs hardcoded that path as
the host side of a volume. They now build the host path for the platform, while
the container side stays Unix - container paths are always Linux paths, and
ExecContainerVolume.Parts already handles the drive-letter colon.

writeEnvFile's 0600 assertion read back as 0666: Go maps Unix permission bits
onto ACLs on Windows, so the mode is not expressible there. The assertion is
skipped on Windows and still enforced everywhere it means something; the
content assertion is unchanged.

The store suite derived its database filename from the spec name. One spec is
named "... (running -> terminal)", and ">" is not a legal Windows filename
character, so every spec in the suite failed in BeforeEach with
ERROR_INVALID_NAME. TempDir is already unique per spec, so the suffix bought
nothing and is dropped.

Only test code changes. The production paths were already Windows-capable, so
this fixes assertions rather than behavior.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R328pa3FUUfga4gYah1iQi
@jahvon
jahvon force-pushed the fix/windows-container-tests branch from 75b2faf to 145e2cd Compare August 27, 2026 06:18
@jahvon
jahvon merged commit c45a6f5 into main Aug 27, 2026
27 checks passed
@jahvon
jahvon deleted the fix/windows-container-tests branch August 27, 2026 06:24
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