Skip to content

Commit 75a0c2b

Browse files
authored
Merge pull request #5264 from mxpv/tests
Run unit tests on CI for MacOS
2 parents ed8cf60 + 4674ad7 commit 75a0c2b

4 files changed

Lines changed: 42 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,33 @@ jobs:
450450
df
451451
losetup -l
452452
453+
tests-mac-os:
454+
name: MacOS unit tests
455+
runs-on: macos-10.15
456+
timeout-minutes: 10
457+
needs: [project, linters, protos, man]
458+
459+
steps:
460+
- uses: actions/setup-go@v2
461+
with:
462+
go-version: '1.16.2'
463+
464+
- uses: actions/checkout@v2
465+
with:
466+
path: src/github.com/containerd/containerd
467+
468+
- name: Set env
469+
run: |
470+
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
471+
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
472+
473+
- name: Tests
474+
env:
475+
GOPROXY: direct
476+
run: |
477+
make test
478+
working-directory: src/github.com/containerd/containerd
479+
453480
cgroup2:
454481
name: CGroupsV2 and SELinux Integration
455482
# nested virtualization is only available on macOS hosts

archive/tar_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !windows
1+
// +build !windows,!darwin
22

33
/*
44
Copyright The containerd Authors.

pkg/cri/server/container_create_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package server
1919
import (
2020
"context"
2121
"path/filepath"
22+
goruntime "runtime"
2223
"testing"
2324

2425
"github.com/containerd/containerd/oci"
@@ -68,6 +69,10 @@ func TestGeneralContainerSpec(t *testing.T) {
6869
}
6970

7071
func TestPodAnnotationPassthroughContainerSpec(t *testing.T) {
72+
if goruntime.GOOS == "darwin" {
73+
t.Skip("not implemented on Darwin")
74+
}
75+
7176
testID := "test-id"
7277
testSandboxID := "sandbox-id"
7378
testContainerName := "container-name"
@@ -272,6 +277,10 @@ func TestVolumeMounts(t *testing.T) {
272277
}
273278

274279
func TestContainerAnnotationPassthroughContainerSpec(t *testing.T) {
280+
if goruntime.GOOS == "darwin" {
281+
t.Skip("not implemented on Darwin")
282+
}
283+
275284
testID := "test-id"
276285
testSandboxID := "sandbox-id"
277286
testContainerName := "container-name"

pkg/cri/server/sandbox_run_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package server
1818

1919
import (
2020
"net"
21+
goruntime "runtime"
2122
"testing"
2223

2324
cni "github.com/containerd/go-cni"
@@ -33,6 +34,10 @@ import (
3334
)
3435

3536
func TestSandboxContainerSpec(t *testing.T) {
37+
if goruntime.GOOS == "darwin" {
38+
t.Skip("not implemented on Darwin")
39+
}
40+
3641
testID := "test-id"
3742
nsPath := "test-cni"
3843
for desc, test := range map[string]struct {

0 commit comments

Comments
 (0)