Skip to content

fix: exclude hook_test.go from Windows builds and propagate ExecStart error in runWaitExec#13683

Open
pawannn wants to merge 2 commits intodocker:mainfrom
pawannn:fix/hook-test-windows-build-tag
Open

fix: exclude hook_test.go from Windows builds and propagate ExecStart error in runWaitExec#13683
pawannn wants to merge 2 commits intodocker:mainfrom
pawannn:fix/hook-test-windows-build-tag

Conversation

@pawannn
Copy link
Copy Markdown

@pawannn pawannn commented Mar 27, 2026

What I did

  • Added //go:build !windows build constraint to pkg/compose/hook_test.go to exclude PTY-dependent tests from native Windows builds. console.NewPty() is Unix-only and caused a compile-time failure when running go test on Windows.
  • Also fixed a silent error swallow in runWaitExec where ExecStart failure was returning nil instead of propagating the error, which could cause lifecycle hooks to silently appear successful when they never ran.

Related issue
Fixes #13682

A picture of a cute animal

Copilot AI review requested due to automatic review settings March 27, 2026 19:50
@pawannn pawannn requested a review from a team as a code owner March 27, 2026 19:50
@pawannn pawannn requested review from glours and ndeloof March 27, 2026 19:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Windows-native go test build failure by excluding PTY-dependent tests in pkg/compose from Windows builds, addressing issue #13682 where console.NewPty() is unavailable on Windows.

Changes:

  • Add //go:build !windows build constraint to pkg/compose/hook_test.go to skip Unix-only PTY tests on Windows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pawannn pawannn changed the title fix: add build tag to hook_test.go to fix Windows build failure (#13682) fix: exclude hook_test.go from Windows builds via !windows build tag Mar 27, 2026
@pawannn pawannn force-pushed the fix/hook-test-windows-build-tag branch from d6395bc to 1c97629 Compare March 27, 2026 19:59
@pawannn pawannn changed the title fix: exclude hook_test.go from Windows builds via !windows build tag fix: exclude hook_test.go from Windows builds Mar 27, 2026
@pawannn pawannn changed the title fix: exclude hook_test.go from Windows builds fix: exclude hook_test.go from Windows builds and propagate ExecStart error in runWaitExec Mar 28, 2026
pawannn added 2 commits March 28, 2026 11:42
Signed-off-by: pawannn <pawankalyan1614@gmail.com>
@pawannn pawannn force-pushed the fix/hook-test-windows-build-tag branch from cbcdcbb to d199446 Compare March 28, 2026 06:12
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.

[BUG] go test fails on Windows: pkg/compose/hook_test.go calls console.NewPty (missing build tags)

2 participants