Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a number of testing & dependency issues #24

Merged
merged 8 commits into from
Mar 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ man/man1
man/man5
man/man8
vendor/pkg/
.vagrant
storageversion/version_autogen.go
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ before_install:
- sudo apt-get -qq update
- sudo apt-get -qq install btrfs-tools libdevmapper-dev
script:
- AUTO_GOPATH=1 make install.tools
- AUTO_GOPATH=1 ./hack/make.sh validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
- AUTO_GOPATH=1 make .gitvalidation
- AUTO_GOPATH=1 make build-binary
- AUTO_GOPATH=1 ./hack/make.sh cross
- sudo env AUTO_GOPATH=1 PATH="$PATH" ./hack/make.sh test-unit
- AUTO_GOPATH=1 make docs
- make install.tools
- ./hack/make.sh validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet
- make .gitvalidation
- make build-binary
- ./hack/make.sh cross
- sudo -E env "PATH=${PATH}" ./hack/make.sh test-unit
- make docs
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,13 @@ gccgo: build-gccgo ## build the gcc-go linux binaries using VMs
$(RUNINVM) hack/make.sh gccgo

test: build ## run the unit and integration tests using VMs
$(RUNINVM) hack/make.sh binary cross test-unit test-integration-cli

test-integration-cli: build ## run the integration tests using VMs
$(RUNINVM) hack/make.sh binary test-integration-cli
$(RUNINVM) hack/make.sh binary cross test-unit

test-unit: build ## run the unit tests using VMs
$(RUNINVM) hack/make.sh test-unit

validate: build ## validate DCO, Seccomp profile generation, gofmt,\n./pkg/ isolation, golint, tests, tomls, go vet and vendor\nusing VMs
$(RUNINVM) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet validate-vendor
$(RUNINVM) hack/make.sh validate-dco validate-gofmt validate-pkg validate-lint validate-test validate-toml validate-vet

lint:
@which gometalinter > /dev/null 2>/dev/null || (echo "ERROR: gometalinter not found. Consider 'make install.tools' target" && false)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
layers, container images, and containers. An `oci-storage` CLI wrapper is also
included for manual and scripting use.

To build the CLI wrapper, use 'make build-binary', optionally passing
'AUTO_GOPATH=1' as an additional argument to avoid having to set $GOPATH
manually. For information on other recognized targets, run 'make help'.
To build the CLI wrapper, use 'make build-binary'.

Operations which use VMs expect to launch them using 'vagrant', defaulting to
using its 'libvirt' provider. The boxes used are also available for the
Expand Down
120 changes: 0 additions & 120 deletions hack/.vendor-helpers.sh

This file was deleted.

21 changes: 8 additions & 13 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set -e

set -o pipefail

export PATH=/usr/local/go/bin:${PATH}
export PKG='github.com/containers/storage'
export SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export MAKEDIR="$SCRIPTDIR/make"
Expand All @@ -38,7 +39,7 @@ DEFAULT_BUNDLES=(

test-unit

gccgo
#gccgo -- failing due to 1.7 incompatibilities
cross
)

Expand Down Expand Up @@ -71,22 +72,16 @@ else
exit 1
fi

if [ "$AUTO_GOPATH" ]; then
rm -rf .gopath
mkdir -p .gopath/src/"$(dirname "${PKG}")"
ln -sf ../../../.. .gopath/src/"${PKG}"
export GOPATH="${PWD}/.gopath:${PWD}/vendor"
export GOPATH="${GOPATH:-/go}"

if [ "$(go env GOOS)" = 'solaris' ]; then
# sys/unix is installed outside the standard library on solaris
# TODO need to allow for version change, need to get version from go
export GOPATH="${GOPATH}:/usr/lib/gocode/1.6.2"
fi
if [ "$(go env GOOS)" = 'solaris' ]; then
# sys/unix is installed outside the standard library on solaris
# TODO need to allow for version change, need to get version from go
export GOPATH="${GOPATH}:/usr/lib/gocode/1.6.2"
fi

if [ ! "$GOPATH" ]; then
echo >&2 'error: missing GOPATH; please see https://golang.org/doc/code.html#GOPATH'
echo >&2 ' alternatively, set AUTO_GOPATH=1'
exit 1
fi

Expand Down Expand Up @@ -186,7 +181,7 @@ test_env() {
GOPATH="$GOPATH" \
GOTRACEBACK=all \
HOME="$ABS_DEST/fake-HOME" \
PATH="$PATH" \
PATH="${GOPATH}/bin:/usr/local/go/bin:$PATH" \
TEMP="$TEMP" \
"$@"
}
Expand Down
2 changes: 1 addition & 1 deletion hack/make/validate-lint
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ unset IFS

errors=()
for f in "${files[@]}"; do
failedLint=$(golint "$f")
failedLint=$(golint "$f")
if [ "$failedLint" ]; then
errors+=( "$failedLint" )
fi
Expand Down
27 changes: 0 additions & 27 deletions hack/make/validate-vendor

This file was deleted.

61 changes: 0 additions & 61 deletions hack/vendor.sh

This file was deleted.

58 changes: 31 additions & 27 deletions vagrant/provision.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
#!/bin/bash
set -e
set -xe

GO_VERSION=1.7.4

source /etc/os-release

case "${ID_LIKE:-${ID:-unknown}}" in
debian)
export DEBIAN_FRONTEND=noninteractive
apt-get -q update
apt-get -q -y install linux-headers-`uname -r`
echo deb http://httpredir.debian.org/debian testing main > /etc/apt/sources.list
echo deb http://httpredir.debian.org/debian testing contrib >> /etc/apt/sources.list
apt-get -q update
apt-get -q -y install systemd
apt-get -q -y install apt make git gccgo golang btrfs-progs libdevmapper-dev
apt-get -q -y install zfs-dkms zfsutils-linux
modprobe aufs
modprobe zfs
;;
fedora)
dnf -y clean all
dnf -y install golang-bin make git-core btrfs-progs-devel device-mapper-devel
dnf -y install gcc-go
alternatives --set go /usr/lib/golang/bin/go
;;
unknown)
echo Unknown box OS, unsure of how to install required packages.
exit 1
;;
debian)
export DEBIAN_FRONTEND=noninteractive
apt-get -q update
apt-get -q -y install linux-headers-`uname -r`
echo deb http://httpredir.debian.org/debian testing main > /etc/apt/sources.list
echo deb http://httpredir.debian.org/debian testing contrib >> /etc/apt/sources.list
apt-get -q update
apt-get -q -y install systemd curl
apt-get -q -y install apt make git btrfs-progs libdevmapper-dev
apt-get -q -y install zfs-dkms zfsutils-linux
curl -sSL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz | tar -xvz -C /usr/local
modprobe aufs
modprobe zfs
;;
fedora)
dnf -y clean all
dnf -y install make git gcc btrfs-progs-devel device-mapper-devel
curl -sSL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz | tar -xvz -C /usr/local
;;
unknown)
echo Unknown box OS, unsure of how to install required packages.
exit 1
;;
esac
mkdir -p /go/src/github.com/containers
rm -f /go/src/github.com/containers/storage
ln -s /vagrant /go/src/github.com/containers/storage
export GOPATH=/go:/go/src/github.com/containers/storage/vendor
export PATH=/usr/lib/go-1.6/bin:/go/src/${PKG}/vendor/src/github.com/golang/lint/golint:${PATH}
go get github.com/golang/lint
export GOPATH=/go
export PATH=/usr/local/go/bin:/go/bin:${PATH}
go get github.com/golang/lint/...
Loading