Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions runner/internal/shim/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math/rand"
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"sync"
Expand All @@ -20,7 +21,7 @@ import (

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

dockerRunner, _ := NewDockerRunner(ctx, params)
dockerRunner, err := NewDockerRunner(ctx, params)
require.NoError(t, err)

taskConfig := createTaskConfig(t)
defer dockerRunner.Remove(context.Background(), taskConfig.ID)

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

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

dockerRunner, _ := NewDockerRunner(ctx, params)
dockerRunner, err := NewDockerRunner(ctx, params)
require.NoError(t, err)

var wg sync.WaitGroup
wg.Add(1)
Expand Down Expand Up @@ -99,7 +103,7 @@ func TestDocker_SSHServerConnect(t *testing.T) {
}

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

dockerRunner, _ := NewDockerRunner(ctx, params)
dockerRunner, err := NewDockerRunner(ctx, params)
require.NoError(t, err)

taskConfig := createTaskConfig(t)
defer dockerRunner.Remove(context.Background(), taskConfig.ID)

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

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

dockerRunner, _ := NewDockerRunner(ctx, params)
dockerRunner, err := NewDockerRunner(ctx, params)
require.NoError(t, err)

taskConfig := createTaskConfig(t)
taskConfig.ShmSize = 1024 * 1024
defer dockerRunner.Remove(context.Background(), taskConfig.ID)
Expand Down
Loading