Update travis to run make build
Ensure all packages can be built, even those not yet imported by binaries. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
parent
a4b2e580f2
commit
dfce91854e
@ -38,6 +38,7 @@ script:
|
|||||||
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
|
- GIT_CHECK_EXCLUDE="./vendor" TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make dco
|
||||||
- make fmt
|
- make fmt
|
||||||
- make vet
|
- make vet
|
||||||
|
- make build
|
||||||
- make binaries
|
- make binaries
|
||||||
- if [ "$GOOS" = "linux" ]; then sudo make install ; fi
|
- if [ "$GOOS" = "linux" ]; then sudo make install ; fi
|
||||||
- if [ "$GOOS" = "linux" ]; then make coverage ; fi
|
- if [ "$GOOS" = "linux" ]; then make coverage ; fi
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// +build !linux
|
// +build !linux,!windows
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
@ -5,8 +5,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/containerd/continuity/sysx"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Applier applies single file changes
|
// Applier applies single file changes
|
||||||
@ -96,12 +94,6 @@ func Link(oldname, newname string) Applier {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetXAttr(name, key, value string) Applier {
|
|
||||||
return applyFn(func(root string) error {
|
|
||||||
return sysx.LSetxattr(name, key, []byte(value), 0)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Make platform specific, windows applier is always no-op
|
// TODO: Make platform specific, windows applier is always no-op
|
||||||
//func Mknod(name string, mode int32, dev int) Applier {
|
//func Mknod(name string, mode int32, dev int) Applier {
|
||||||
// return func(root string) error {
|
// return func(root string) error {
|
||||||
|
11
fs/fstest/file_unix.go
Normal file
11
fs/fstest/file_unix.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package fstest
|
||||||
|
|
||||||
|
import "github.com/containerd/continuity/sysx"
|
||||||
|
|
||||||
|
func SetXAttr(name, key, value string) Applier {
|
||||||
|
return applyFn(func(root string) error {
|
||||||
|
return sysx.LSetxattr(name, key, []byte(value), 0)
|
||||||
|
})
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
// +build !windows
|
||||||
|
|
||||||
package shim
|
package shim
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package cgroups
|
package cgroups
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/containerd/containerd/fs/fstest"
|
"github.com/containerd/containerd/fs/fstest"
|
||||||
@ -28,8 +27,8 @@ func SnapshotterSuite(t *testing.T, name string, snapshotterFn func(ctx context.
|
|||||||
func makeTest(t *testing.T, name string, snapshotterFn func(ctx context.Context, root string) (snapshot.Snapshotter, func(), error), fn func(ctx context.Context, t *testing.T, snapshotter snapshot.Snapshotter, work string)) func(t *testing.T) {
|
func makeTest(t *testing.T, name string, snapshotterFn func(ctx context.Context, root string) (snapshot.Snapshotter, func(), error), fn func(ctx context.Context, t *testing.T, snapshotter snapshot.Snapshotter, work string)) func(t *testing.T) {
|
||||||
return func(t *testing.T) {
|
return func(t *testing.T) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
oldumask := syscall.Umask(0)
|
restoreMask := clearMask()
|
||||||
defer syscall.Umask(oldumask)
|
defer restoreMask()
|
||||||
// Make two directories: a snapshotter root and a play area for the tests:
|
// Make two directories: a snapshotter root and a play area for the tests:
|
||||||
//
|
//
|
||||||
// /tmp
|
// /tmp
|
||||||
|
12
snapshot/testsuite/testsuite_unix.go
Normal file
12
snapshot/testsuite/testsuite_unix.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package testsuite
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
func clearMask() func() {
|
||||||
|
oldumask := syscall.Umask(0)
|
||||||
|
return func() {
|
||||||
|
syscall.Umask(oldumask)
|
||||||
|
}
|
||||||
|
}
|
5
snapshot/testsuite/testsuite_windows.go
Normal file
5
snapshot/testsuite/testsuite_windows.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package testsuite
|
||||||
|
|
||||||
|
func clearMask() func() {
|
||||||
|
return func() {}
|
||||||
|
}
|
@ -6,9 +6,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd/mount"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ func init() {
|
|||||||
// Unmount unmounts a given mountPoint and sets t.Error if it fails
|
// Unmount unmounts a given mountPoint and sets t.Error if it fails
|
||||||
func Unmount(t *testing.T, mountPoint string) {
|
func Unmount(t *testing.T, mountPoint string) {
|
||||||
t.Log("unmount", mountPoint)
|
t.Log("unmount", mountPoint)
|
||||||
if err := syscall.Unmount(mountPoint, 0); err != nil {
|
if err := mount.Unmount(mountPoint, 0); err != nil {
|
||||||
t.Error("Could not umount", mountPoint, err)
|
t.Error("Could not umount", mountPoint, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user