fix(test): make container and store tests platform-aware on Windows - #451
Merged
Conversation
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
force-pushed
the
fix/windows-container-tests
branch
from
August 27, 2026 06:18
75b2faf to
145e2cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-cionly runs behind thetest:windowslabel, and no PR had carried it since the code that introduced them. Labelling #439 ran them for the first time.expands and mounts workspace-relative and absolute volumes/opt/datais not absolute underfilepath.IsAbsexpands volume host paths [absolute]writeEnvFile writes sorted 0600 entries0666BoltDataStore— entire suiteERROR_INVALID_NAMEinBeforeEachVolume paths.
expandVolumeHostgates onfilepath.IsAbs, which rejects/opt/dataon 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, andExecContainerVolume.Partsalready handles the drive-letter colon.File mode. Go maps Unix permission bits onto ACLs on Windows, so
0600is not expressible and reads back as0666. 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:One spec is named
... (running -> terminal), and>is not a legal Windows filename character — soBeforeEachfailed withERROR_INVALID_NAME(0x7b).TempDiris already unique per spec, so the suffix bought nothing and is dropped.Scope
Test-only. The production paths were already Windows-capable —
Partshandles drive letters, and container paths are correctly validated with Unix semantics. This fixes assertions, not behavior.Testing
Verified on real Windows runners via
workflow_dispatchrather than inferred fromGOOSreasoning:writeEnvFile).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