From 82823a6634be4b43a1130b244ee1a1d9c83a1ec6 Mon Sep 17 00:00:00 2001 From: Vivian Kong Date: Fri, 17 Jan 2020 10:39:26 -0500 Subject: [PATCH] Allow tests to run on s390x (#7096) Signed-off-by: Vivian Kong --- Makefile | 5 +++++ pkg/plugin/plugin_test.go | 3 +++ 2 files changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 0a3b08548..7d254e919 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ GOPATH = $(shell go env GOPATH) DEP = $(GOPATH)/bin/dep GOX = $(GOPATH)/bin/gox GOIMPORTS = $(GOPATH)/bin/goimports +ARCH = $(shell uname -p) ACCEPTANCE_DIR:=../acceptance-testing # To specify the subset of acceptance tests to run. '.' means all tests @@ -67,7 +68,11 @@ $(BINDIR)/$(BINNAME): $(SRC) .PHONY: test test: build +ifeq ($(ARCH),s390x) +test: TESTFLAGS += -v +else test: TESTFLAGS += -race -v +endif test: test-style test: test-unit diff --git a/pkg/plugin/plugin_test.go b/pkg/plugin/plugin_test.go index f637eca28..076ae1187 100644 --- a/pkg/plugin/plugin_test.go +++ b/pkg/plugin/plugin_test.go @@ -87,6 +87,7 @@ func TestPlatformPrepareCommand(t *testing.T) { PlatformCommand: []PlatformCommand{ {OperatingSystem: "linux", Architecture: "i386", Command: "echo -n linux-i386"}, {OperatingSystem: "linux", Architecture: "amd64", Command: "echo -n linux-amd64"}, + {OperatingSystem: "linux", Architecture: "s390x", Command: "echo -n linux-s390x"}, {OperatingSystem: "windows", Architecture: "amd64", Command: "echo -n win-64"}, }, }, @@ -98,6 +99,8 @@ func TestPlatformPrepareCommand(t *testing.T) { osStrCmp = "linux-i386" } else if os == "linux" && arch == "amd64" { osStrCmp = "linux-amd64" + } else if os == "linux" && arch == "s390x" { + osStrCmp = "linux-s390x" } else if os == "windows" && arch == "amd64" { osStrCmp = "win-64" } else {