Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit bc4b087

Browse files
committed
Add buildtags to go test
1 parent b30fb89 commit bc4b087

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ go:
99
- 1.11.x
1010

1111
script:
12-
- make install-deps build test integration-test stage-release-binaries
12+
- make install-deps
13+
- make
14+
- make integration-test
15+
- make stage-release-binaries

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ $(LOCAL_BINARY): $(SOURCES) GITCOMMIT_SHA
2323
./scripts/build_binary.sh ./bin/local img2lambda $(VERSION) $(shell cat GITCOMMIT_SHA)
2424
@echo "Built img2lambda"
2525

26-
.PHONY: test
27-
test:
28-
go test -v -timeout 30s -short -cover $(shell go list ./img2lambda/... | grep -v /vendor/)
29-
3026
.PHONY: integration-test
3127
integration-test: $(LOCAL_BINARY)
3228
./scripts/build_example.sh
@@ -66,7 +62,7 @@ docker-test:
6662
--workdir=/usr/src/app/src/github.com/awslabs/img2lambda \
6763
--env GOPATH=/usr/src/app \
6864
--env IMG_TOOL_RELEASE=$(IMG_TOOL_RELEASE) \
69-
golang:1.11 make test
65+
golang:1.11 make
7066

7167
.PHONY: stage-release-binaries
7268
stage-release-binaries: $(LINUX_BINARY) $(DARWIN_BINARY) $(WINDOWS_BINARY)

scripts/build_binary.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
46
# SPDX-License-Identifier: MIT-0
57

@@ -26,6 +28,9 @@ if [[ -n "${4}" ]]; then
2628
fi
2729

2830
GOOS=$TARGET_GOOS go build -a -tags="${BUILDTAGS}" -ldflags "-s ${VERSION_LDFLAGS}" -o $1/$2 ./img2lambda/cli
31+
32+
go test -v -tags="${BUILDTAGS}" -timeout 30s -short -cover $(go list ./img2lambda/... | grep -v /vendor/ | grep -v /internal/)
33+
2934
cd $1
3035
md5sum $2 > $2.md5
3136
sha256sum $2 > $2.sha256

0 commit comments

Comments
 (0)