Skip to content

Commit

Permalink
Use bats v1.2.0 release for CI
Browse files Browse the repository at this point in the history
We now can stick to a stable bats version since they have been released
v1.2.0: https://github.com/bats-core/bats-core/releases/tag/v1.2.0

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
  • Loading branch information
saschagrunert committed May 11, 2020
1 parent 2be4d9c commit f565281
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Expand Up @@ -4,9 +4,9 @@ version: 2.1
stdenv: &stdenv
environment:
GOCACHE: &gocache /tmp/go-build
IMAGE: &image quay.io/crio/crio-build-amd64-go1.13:1.17-1.1.2
IMAGELEGACY: &imagelegacy quay.io/crio/crio-build-amd64-go1.10:1.17-1.1.2
IMAGE386: &image386 quay.io/crio/crio-build-386-go1.13:1.17-1.1.2
IMAGE: &image quay.io/crio/crio-build-amd64-go1.13:1.17-1.1.3
IMAGELEGACY: &imagelegacy quay.io/crio/crio-build-amd64-go1.10:1.17-1.1.3
IMAGE386: &image386 quay.io/crio/crio-build-386-go1.13:1.17-1.1.3
IMAGENIX: &imagenix quay.io/crio/nix:1.1.0
JOBS: &jobs 4
WORKDIR: &workdir /go/src/github.com/cri-o/cri-o
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -87,7 +87,7 @@ SHRINKFLAGS := -s -w
BASE_LDFLAGS = ${SHRINKFLAGS} -X main.gitCommit=${GIT_COMMIT} -X main.buildInfo=${SOURCE_DATE_EPOCH}
LDFLAGS = -ldflags '${BASE_LDFLAGS}'

TESTIMAGE_VERSION := 1.17-1.1.2
TESTIMAGE_VERSION := 1.17-1.1.3
TESTIMAGE_REGISTRY := quay.io/crio
TESTIMAGE_SCRIPT := scripts/build-test-image -r $(TESTIMAGE_REGISTRY) -v $(TESTIMAGE_VERSION)
TESTIMAGE_NAME ?= $(shell $(TESTIMAGE_SCRIPT) -d)
Expand Down
1 change: 1 addition & 0 deletions contrib/test/integration/build/bats.yml
Expand Up @@ -4,6 +4,7 @@
git:
repo: "https://github.com/bats-core/bats-core.git"
dest: "{{ ansible_env.GOPATH }}/src/github.com/bats-core/bats-core"
version: v1.2.0

- name: install bats
command: "./install.sh /usr/local"
Expand Down
8 changes: 6 additions & 2 deletions scripts/build-test-image
Expand Up @@ -11,6 +11,7 @@ declare -A VERSIONS=(
["conmon"]=v2.0.15
["cri-tools"]=v1.17.0
["runc"]=v1.0.0-rc9
["bats"]=v1.2.0
)

# Available architectures and go versions
Expand Down Expand Up @@ -202,8 +203,11 @@ install_packages() {
}

install_bats() {
run git clone https://github.com/bats-core/bats-core --depth=1
run ./bats-core/install.sh /usr
run git clone https://github.com/bats-core/bats-core
run bash -c "\
cd bats-core && \
git checkout ${VERSIONS["bats"]} && \
./install.sh /usr"
run rm -rf bats-core
run mkdir -p ~/.parallel
run touch ~/.parallel/will-cite
Expand Down
8 changes: 6 additions & 2 deletions scripts/circle-setup
Expand Up @@ -7,6 +7,7 @@ declare -A VERSIONS=(
["conmon"]=v2.0.9
["cri-tools"]=v1.17.0
["runc"]=13b1603fd0e37db1764433a140d494b2e9f05805
["bats"]=v1.2.0
)

main() {
Expand Down Expand Up @@ -65,8 +66,11 @@ install_packages() {
}

install_bats() {
git clone https://github.com/bats-core/bats-core --depth=1
sudo ./bats-core/install.sh /usr/local
git clone https://github.com/bats-core/bats-core
pushd bats-core
git checkout "${VERSIONS["bats"]}"
sudo ./install.sh /usr/local
popd
rm -rf bats-core
mkdir -p ~/.parallel
touch ~/.parallel/will-cite
Expand Down
4 changes: 2 additions & 2 deletions server/inspect_test.go
Expand Up @@ -164,7 +164,7 @@ func TestGetContainerInfoCtrStateNil(t *testing.T) {
labels := map[string]string{}
annotations := map[string]string{}
getContainerFunc := func(id string) *oci.Container {
container, err := oci.NewContainer("testid", "testname", "", "/container/logs", labels, annotations, annotations, "imageName", "imageName", "imageRef", &runtime.ContainerMetadata{}, "testsandboxid", false, false, false, false, "", "/root/for/container", created, "SIGKILL")
container, err := oci.NewContainer("testid", "testname", "", "/container/logs", labels, annotations, annotations, "imageName", "imageName", "imageRef", &runtime.ContainerMetadata{}, "testsandboxid", false, false, false, "", "/root/for/container", created, "SIGKILL")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestGetContainerInfoSandboxNotFound(t *testing.T) {
labels := map[string]string{}
annotations := map[string]string{}
getContainerFunc := func(id string) *oci.Container {
container, err := oci.NewContainer("testid", "testname", "", "/container/logs", labels, annotations, annotations, "imageName", "imageName", "imageRef", &runtime.ContainerMetadata{}, "testsandboxid", false, false, false, false, "", "/root/for/container", created, "SIGKILL")
container, err := oci.NewContainer("testid", "testname", "", "/container/logs", labels, annotations, annotations, "imageName", "imageName", "imageRef", &runtime.ContainerMetadata{}, "testsandboxid", false, false, false, "", "/root/for/container", created, "SIGKILL")
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion server/suite_test.go
Expand Up @@ -163,7 +163,7 @@ var beforeEach = func() {
make(map[string]string), make(map[string]string),
make(map[string]string), "", "", "",
&pb.ContainerMetadata{}, sandboxID, false, false,
false, false, "", "", time.Now(), "")
false, "", "", time.Now(), "")
Expect(err).To(BeNil())

// Initialize test streaming server
Expand Down
2 changes: 1 addition & 1 deletion test/crio-wipe.bats
Expand Up @@ -28,7 +28,7 @@ function teardown() {

# run crio_wipe calls crio_wipe and tests it succeeded
function run_crio_wipe() {
run $CRIO_BINARY --config "$CRIO_CONFIG" wipe
run $CRIO_BINARY_PATH --config "$CRIO_CONFIG" wipe
echo "$status"
echo "$output"
[ "$status" -eq 0 ]
Expand Down

0 comments on commit f565281

Please sign in to comment.