Skip to content

Fix Windows test issues - #177

Merged
nodeselector merged 5 commits into
github:mainfrom
jessehouwing:fix/pin-windows-paths
Oct 20, 2026
Merged

nodeselector merged 5 commits into
github:mainfrom
jessehouwing:fix/pin-windows-paths

Conversation

@jessehouwing

@jessehouwing jessehouwing commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes tests that fail or hang on Windows. Test-only; no production code changes.

Found and fixed so far

  1. internal/pin/commit_test.go: four tests (TestCommitDependencyFreeWorkflow, TestCommitPartialResolution, TestCommitRemovesDependenciesDroppedFromWorkflow, TestCommitRekeysAnnotatedTagObjectWithUses) used native filepath.Join paths (backslashes) as lockfile keys. Lockfile keys are slash-normalized, so they now use workflowfile.KeyFromPath.
  2. cmd/gh-actions-lock/command_test.go: runCommandWithHTTPContext read its os.Pipe stdout/stderr only after Execute returned. Windows pipes buffer ~4 KB, so large output (e.g. --json) blocked the writer forever and TestCheckCommand_JSONGolden hung. Both pipes are now drained concurrently.
  3. cmd/gh-actions-lock/runlog_test.go: TestWriteRunLog asserted file mode 0600, but Windows does not report POSIX permission bits (it returns 0666). The mode check now lives in its own test, TestWriteRunLog_FileMode, which is skipped on Windows (a Windows counterpart, TestWriteRunLog_FileModeWindows, asserts the log is a writable regular file); the rest of TestWriteRunLog still runs there.

The tests used native filepath.Join paths as lockfile keys, which contain
backslashes on Windows. Production code normalizes with KeyFromPath.

Co-authored-by: Copilot <[email protected]>
@jessehouwing
jessehouwing marked this pull request as ready for review October 16, 2026 13:27
Copilot AI max review requested due to automatic review settings October 16, 2026 13:27
@jessehouwing
jessehouwing requested a review from a team as a code owner October 16, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The test-only changes preserve test intent and align store keys with production handling.

0 open findings

What changed in this PR

Fixes Windows failures in commit tests by normalizing lockfile keys consistently with production.

Changes:

  • Uses workflowfile.KeyFromPath for test store operations.
  • Preserves native paths in workflow entries and plans.
File Description
internal/​pin/​commit_test.go Normalizes lockfile keys in test setup and assertions.

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Windows pipes buffer ~4 KB, so reading after Execute deadlocks on large
JSON output (hangs TestCheckCommand_JSONGolden).

Co-authored-by: Copilot <[email protected]>
@jessehouwing jessehouwing changed the title Fix internal/pin commit tests on Windows Fix Windows test issues Oct 16, 2026
@nodeselector
nodeselector merged commit ba37813 into github:main Oct 20, 2026
5 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.

3 participants