Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7e0266

Browse files
authored
fix: skip bash tests on Windows (#19277)
Adds Windows compatibility to toolsdk testsThis PR adds Windows compatibility to the toolsdk tests by:1. Adding build constraints to exclude bash_test.go from running onWindows2. Skipping the WorkspaceSSHExec test on Windows platforms with a clearmessageThese changes ensure tests run properly across all supported platforms.Related tocoder/internal#798Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parentdadeab8 commitb7e0266

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎codersdk/toolsdk/bash_test.go‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package toolsdk_test
22

33
import (
44
"context"
5+
"runtime"
56
"testing"
67

78
"github.com/stretchr/testify/require"
@@ -14,6 +15,9 @@ import (
1415

1516
funcTestWorkspaceBash(t*testing.T) {
1617
t.Parallel()
18+
ifruntime.GOOS=="windows" {
19+
t.Skip("Skipping on Windows: Workspace MCP bash tools rely on a Unix-like shell (bash) and POSIX/SSH semantics. Use Linux/macOS or WSL for these tests.")
20+
}
1721

1822
t.Run("ValidateArgs",func(t*testing.T) {
1923
t.Parallel()
@@ -97,6 +101,9 @@ func TestWorkspaceBash(t *testing.T) {
97101

98102
funcTestNormalizeWorkspaceInput(t*testing.T) {
99103
t.Parallel()
104+
ifruntime.GOOS=="windows" {
105+
t.Skip("Skipping on Windows: Workspace MCP bash tools rely on a Unix-like shell (bash) and POSIX/SSH semantics. Use Linux/macOS or WSL for these tests.")
106+
}
100107

101108
testCases:= []struct {
102109
namestring
@@ -151,6 +158,9 @@ func TestNormalizeWorkspaceInput(t *testing.T) {
151158

152159
funcTestAllToolsIncludesBash(t*testing.T) {
153160
t.Parallel()
161+
ifruntime.GOOS=="windows" {
162+
t.Skip("Skipping on Windows: Workspace MCP bash tools rely on a Unix-like shell (bash) and POSIX/SSH semantics. Use Linux/macOS or WSL for these tests.")
163+
}
154164

155165
// Verify that WorkspaceBash is included in the All slice
156166
found:=false
@@ -169,6 +179,9 @@ func TestAllToolsIncludesBash(t *testing.T) {
169179

170180
funcTestWorkspaceBashTimeout(t*testing.T) {
171181
t.Parallel()
182+
ifruntime.GOOS=="windows" {
183+
t.Skip("Skipping on Windows: Workspace MCP bash tools rely on a Unix-like shell (bash) and POSIX/SSH semantics. Use Linux/macOS or WSL for these tests.")
184+
}
172185

173186
t.Run("TimeoutDefaultValue",func(t*testing.T) {
174187
t.Parallel()
@@ -251,6 +264,9 @@ func TestWorkspaceBashTimeout(t *testing.T) {
251264

252265
funcTestWorkspaceBashTimeoutIntegration(t*testing.T) {
253266
t.Parallel()
267+
ifruntime.GOOS=="windows" {
268+
t.Skip("Skipping on Windows: Workspace MCP bash tools rely on a Unix-like shell (bash) and POSIX/SSH semantics. Use Linux/macOS or WSL for these tests.")
269+
}
254270

255271
t.Run("ActualTimeoutBehavior",func(t*testing.T) {
256272
t.Parallel()
@@ -338,6 +354,9 @@ func TestWorkspaceBashTimeoutIntegration(t *testing.T) {
338354

339355
funcTestWorkspaceBashBackgroundIntegration(t*testing.T) {
340356
t.Parallel()
357+
ifruntime.GOOS=="windows" {
358+
t.Skip("Skipping on Windows: Workspace MCP bash tools rely on a Unix-like shell (bash) and POSIX/SSH semantics. Use Linux/macOS or WSL for these tests.")
359+
}
341360

342361
t.Run("BackgroundCommandCapturesOutput",func(t*testing.T) {
343362
t.Parallel()

‎codersdk/toolsdk/toolsdk_test.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"os"
7+
"runtime"
78
"sort"
89
"sync"
910
"testing"
@@ -397,6 +398,9 @@ func TestTools(t *testing.T) {
397398
})
398399

399400
t.Run("WorkspaceSSHExec",func(t*testing.T) {
401+
ifruntime.GOOS=="windows" {
402+
t.Skip("WorkspaceSSHExec is not supported on Windows")
403+
}
400404
// Setup workspace exactly like main SSH tests
401405
client,workspace,agentToken:=setupWorkspaceForAgent(t)
402406

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp