Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Use golang 1.11 from epel
Browse files Browse the repository at this point in the history
  • Loading branch information
jarifibrahim committed Dec 13, 2018
1 parent ce00568 commit a59f51b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
13 changes: 7 additions & 6 deletions .make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# mode can be: set, count, or atomic
COVERAGE_MODE ?= set

# By default no go test calls will use the -v switch when running tests.
# By default no go test off calls will use the -v switch when running tests.
# But if you want you can enable that by setting GO_TEST_VERBOSITY_FLAG=-v
GO_TEST_VERBOSITY_FLAG ?=

Expand Down Expand Up @@ -156,7 +156,7 @@ test-unit: prebuild-check clean-coverage-unit $(COV_PATH_UNIT)
test-unit-no-coverage: prebuild-check $(SOURCES)
$(call log-info,"Running test: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_UNIT_TEST=1 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_UNIT_TEST=1 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test -vet off $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

.PHONY: test-unit-no-coverage-junit
test-unit-no-coverage-junit: prebuild-check ${GO_JUNIT_BIN} ${TMP_PATH}
Expand All @@ -173,12 +173,12 @@ test-integration: prebuild-check clean-coverage-integration migrate-database $(C
test-integration-no-coverage: prebuild-check migrate-database $(SOURCES)
$(call log-info,"Running test: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test $(GO_TEST_BINARIES_PARALLEL_FLAG) $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test -vet off $(GO_TEST_BINARIES_PARALLEL_FLAG) $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

test-integration-benchmark: prebuild-check migrate-database $(SOURCES)
$(call log-info,"Running benchmarks: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test -run=^$$ -bench=. -cpu 1,2,4 -test.benchmem $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) | grep -E "Bench|allocs"
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test -vet off -run=^$$ -bench=. -cpu 1,2,4 -test.benchmem $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES) | grep -E "Bench|allocs"

.PHONY: test-remote
## Runs the remote tests and produces coverage files for each package.
Expand All @@ -189,13 +189,13 @@ test-remote: prebuild-check clean-coverage-remote $(COV_PATH_REMOTE)
test-remote-no-coverage: prebuild-check $(SOURCES)
$(call log-info,"Running test: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_REMOTE=1 F8_RESOURCE_UNIT_TEST=0 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_REMOTE=1 F8_RESOURCE_UNIT_TEST=0 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test -vet off $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

.PHONY: test-migration
## Runs the migration tests and should be executed before running the integration tests
## in order to have a clean database
test-migration: prebuild-check migration/sqlbindata.go migration/sqlbindata_test.go
F8_RESOURCE_DATABASE=1 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test $(GO_TEST_VERBOSITY_FLAG) github.com/fabric8-services/fabric8-wit/migration
F8_RESOURCE_DATABASE=1 F8_LOG_LEVEL=$(F8_LOG_LEVEL) go test -vet off $(GO_TEST_VERBOSITY_FLAG) github.com/fabric8-services/fabric8-wit/migration

# Starts the WIT server and waits until its running
define start-wit
Expand Down Expand Up @@ -473,6 +473,7 @@ $(eval COV_OUT_FILE := $(COV_DIR)/$(PACKAGE_NAME)/coverage.$(TEST_NAME).mode-$(C
go test $(PACKAGE_NAME) \
$(GO_TEST_BINARIES_PARALLEL_FLAG) \
$(GO_TEST_VERBOSITY_FLAG) \
-vet off \
-coverprofile $(COV_OUT_FILE) \
-coverpkg $(ALL_PKGS_COMMA_SEPARATED) \
-covermode=$(COVERAGE_MODE) \
Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ ENV LANG=en_US.utf8
ARG USE_GO_VERSION_FROM_WEBSITE=0

# Some packages might seem weird but they are required by the RVM installer.
RUN yum --enablerepo=centosplus install -y --quiet \
RUN yum install epel-release -y \
&& yum --enablerepo=centosplus --enablerepo=epel install -y --quiet \
findutils \
git \
$(test -z $USE_GO_VERSION_FROM_WEBSITE && echo "golang") \
$(test "$USE_GO_VERSION_FROM_WEBSITE" != 1 && echo "golang") \
make \
procps-ng \
tar \
Expand All @@ -18,13 +19,13 @@ RUN yum --enablerepo=centosplus install -y --quiet \
postgresql \
&& yum clean all

RUN test -n $USE_GO_VERSION_FROM_WEBSITE \
&& cd /tmp \
RUN if [[ "$USE_GO_VERSION_FROM_WEBSITE" = 1 ]]; then cd /tmp \
&& wget --no-verbose https://dl.google.com/go/go1.10.linux-amd64.tar.gz \
&& echo "b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33 go1.10.linux-amd64.tar.gz" > checksum \
&& sha256sum -c checksum \
&& tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz \
&& rm -f go1.10.linux-amd64.tar.gz
&& rm -f go1.10.linux-amd64.tar.gz \
fi
ENV PATH=$PATH:/usr/local/go/bin

# Get dep for Go package management and make sure the directory has full rwz permissions for non-root users
Expand Down
2 changes: 0 additions & 2 deletions cico_run_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

. cico_setup.sh

export USE_GO_VERSION_FROM_WEBSITE=1

cico_setup;

run_tests_with_coverage;

0 comments on commit a59f51b

Please sign in to comment.