Skip to content

Commit 4612ff4

Browse files
authored
Skip runner integration tests on macOS in CI (#3112)
* Skip runner integration tests on macOS in CI * Add missing check
1 parent 7e728a4 commit 4612ff4

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

runner/internal/shim/docker_test.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"math/rand"
77
"os"
88
"os/exec"
9+
"runtime"
910
"strconv"
1011
"strings"
1112
"sync"
@@ -20,7 +21,7 @@ import (
2021

2122
// TestDocker_SSHServer pulls ubuntu image (without sshd), installs openssh-server and exits
2223
func TestDocker_SSHServer(t *testing.T) {
23-
if testing.Short() {
24+
if testing.Short() || (os.Getenv("CI") == "true" && runtime.GOOS == "darwin") {
2425
t.Skip()
2526
}
2627
t.Parallel()
@@ -35,7 +36,9 @@ func TestDocker_SSHServer(t *testing.T) {
3536
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
3637
defer cancel()
3738

38-
dockerRunner, _ := NewDockerRunner(ctx, params)
39+
dockerRunner, err := NewDockerRunner(ctx, params)
40+
require.NoError(t, err)
41+
3942
taskConfig := createTaskConfig(t)
4043
defer dockerRunner.Remove(context.Background(), taskConfig.ID)
4144

@@ -45,7 +48,7 @@ func TestDocker_SSHServer(t *testing.T) {
4548

4649
// TestDocker_SSHServerConnect pulls ubuntu image (without sshd), installs openssh-server and tries to connect via SSH
4750
func TestDocker_SSHServerConnect(t *testing.T) {
48-
if testing.Short() {
51+
if testing.Short() || (os.Getenv("CI") == "true" && runtime.GOOS == "darwin") {
4952
t.Skip()
5053
}
5154
t.Parallel()
@@ -66,7 +69,8 @@ func TestDocker_SSHServerConnect(t *testing.T) {
6669
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
6770
defer cancel()
6871

69-
dockerRunner, _ := NewDockerRunner(ctx, params)
72+
dockerRunner, err := NewDockerRunner(ctx, params)
73+
require.NoError(t, err)
7074

7175
var wg sync.WaitGroup
7276
wg.Add(1)
@@ -99,7 +103,7 @@ func TestDocker_SSHServerConnect(t *testing.T) {
99103
}
100104

101105
func TestDocker_ShmNoexecByDefault(t *testing.T) {
102-
if testing.Short() {
106+
if testing.Short() || (os.Getenv("CI") == "true" && runtime.GOOS == "darwin") {
103107
t.Skip()
104108
}
105109
t.Parallel()
@@ -113,7 +117,9 @@ func TestDocker_ShmNoexecByDefault(t *testing.T) {
113117
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
114118
defer cancel()
115119

116-
dockerRunner, _ := NewDockerRunner(ctx, params)
120+
dockerRunner, err := NewDockerRunner(ctx, params)
121+
require.NoError(t, err)
122+
117123
taskConfig := createTaskConfig(t)
118124
defer dockerRunner.Remove(context.Background(), taskConfig.ID)
119125

@@ -122,7 +128,7 @@ func TestDocker_ShmNoexecByDefault(t *testing.T) {
122128
}
123129

124130
func TestDocker_ShmExecIfSizeSpecified(t *testing.T) {
125-
if testing.Short() {
131+
if testing.Short() || (os.Getenv("CI") == "true" && runtime.GOOS == "darwin") {
126132
t.Skip()
127133
}
128134
t.Parallel()
@@ -136,7 +142,9 @@ func TestDocker_ShmExecIfSizeSpecified(t *testing.T) {
136142
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
137143
defer cancel()
138144

139-
dockerRunner, _ := NewDockerRunner(ctx, params)
145+
dockerRunner, err := NewDockerRunner(ctx, params)
146+
require.NoError(t, err)
147+
140148
taskConfig := createTaskConfig(t)
141149
taskConfig.ShmSize = 1024 * 1024
142150
defer dockerRunner.Remove(context.Background(), taskConfig.ID)

0 commit comments

Comments
 (0)