Skip to content

Commit 31b973d

Browse files
committed
fix: skip bash tests on Windows
Change-Id: I8838e8c2d38766ad142e1f5bb224a2f82ac17d6b Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent dadeab8 commit 31b973d

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"
@@ -13,6 +14,9 @@ import (
1314
)
1415

1516
func TestWorkspaceBash(t *testing.T) {
17+
if runtime.GOOS == "windows" {
18+
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.")
19+
}
1620
t.Parallel()
1721

1822
t.Run("ValidateArgs", func(t *testing.T) {
@@ -96,6 +100,9 @@ func TestWorkspaceBash(t *testing.T) {
96100
}
97101

98102
func TestNormalizeWorkspaceInput(t *testing.T) {
103+
if runtime.GOOS == "windows" {
104+
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.")
105+
}
99106
t.Parallel()
100107

101108
testCases := []struct {
@@ -150,6 +157,9 @@ func TestNormalizeWorkspaceInput(t *testing.T) {
150157
}
151158

152159
func TestAllToolsIncludesBash(t *testing.T) {
160+
if runtime.GOOS == "windows" {
161+
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.")
162+
}
153163
t.Parallel()
154164

155165
// Verify that WorkspaceBash is included in the All slice
@@ -168,6 +178,9 @@ func TestAllToolsIncludesBash(t *testing.T) {
168178
// timeout functionality with a real SSH connection and mock clock.
169179

170180
func TestWorkspaceBashTimeout(t *testing.T) {
181+
if runtime.GOOS == "windows" {
182+
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.")
183+
}
171184
t.Parallel()
172185

173186
t.Run("TimeoutDefaultValue", func(t *testing.T) {
@@ -250,6 +263,9 @@ func TestWorkspaceBashTimeout(t *testing.T) {
250263
}
251264

252265
func TestWorkspaceBashTimeoutIntegration(t *testing.T) {
266+
if runtime.GOOS == "windows" {
267+
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.")
268+
}
253269
t.Parallel()
254270

255271
t.Run("ActualTimeoutBehavior", func(t *testing.T) {
@@ -337,6 +353,9 @@ func TestWorkspaceBashTimeoutIntegration(t *testing.T) {
337353
}
338354

339355
func TestWorkspaceBashBackgroundIntegration(t *testing.T) {
356+
if runtime.GOOS == "windows" {
357+
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.")
358+
}
340359
t.Parallel()
341360

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

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+
if runtime.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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy