Skip to content

Commit f9cf999

Browse files
committed
Evergreen simplification
1 parent d61e99b commit f9cf999

File tree

2 files changed

+24
-47
lines changed

2 files changed

+24
-47
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ COVERAGE=coverage.out
99
VERSION=$(shell git describe --always --tags)
1010
LINKER_FLAGS=-X github.com/mongodb/mongocli/internal/version.Version=${VERSION}
1111

12-
E2E_CMD?=go test
12+
TEST_CMD?=go test
1313
E2E_TAGS?=e2e
1414

1515
export PATH := ./bin:$(PATH)
@@ -34,7 +34,7 @@ fmt: ## Format code
3434
.PHONY: test
3535
test: ## Run tests
3636
@echo "==> Running tests..."
37-
go test -race -cover -count=1 -coverprofile ${COVERAGE} ./internal...
37+
$(TEST_CMD) -race -cover -count=1 -coverprofile ${COVERAGE} ./internal...
3838

3939
.PHONY: lint
4040
lint: ## Run linter
@@ -67,7 +67,7 @@ build: ## Generate a binary in ./bin
6767
e2e-test: build ## Run E2E tests
6868
@echo "==> Running E2E tests..."
6969
# the target assumes the MCLI-* environment variables are exported
70-
$(E2E_CMD) -v -p 1 -parallel 1 -timeout 0 -tags="$(E2E_TAGS)" ./e2e...
70+
$(TEST_CMD) -v -p 1 -parallel 1 -timeout 0 -tags="$(E2E_TAGS)" ./e2e...
7171

7272
.PHONY: install
7373
install: ## Install a binary in $GOPATH/bin

build/ci/evergreen.yml

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,16 @@ functions:
2929
<<: *go_options
3030
command: make build
3131
"test":
32-
- command: shell.exec
32+
- command: subprocess.exec
3333
type: test
3434
params:
35+
add_to_path:
36+
- ${go_bin}
3537
working_dir: src/github.com/mongodb/mongocli
36-
script: |
37-
set -o xtrace
38-
set -o errexit
39-
set -o verbose
40-
41-
export GOROOT="${go_root}"
42-
export PATH="./bin:$GOROOT/bin:$PATH"
43-
44-
gotestsum --junitfile unit-tests.xml -- -race -cover -count=1 -coverprofile coverage.out ./internal...
38+
env:
39+
TEST_CMD: gotestsum --junitfile unit-tests.xml --
40+
<<: *go_options
41+
command: make test
4542
"generate html coverage":
4643
- command: subprocess.exec
4744
type: test
@@ -77,7 +74,7 @@ functions:
7774
MCLI_PRIVATE_API_KEY: ${atlas_private_api_key}
7875
MCLI_PUBLIC_API_KEY: ${atlas_public_api_key}
7976
MCLI_SERVICE: cloud
80-
E2E_CMD: gotestsum --junitfile e2e-tests.xml --
77+
TEST_CMD: gotestsum --junitfile e2e-tests.xml --
8178
E2E_TAGS: e2e,atlas
8279
<<: *go_options
8380
command: make e2e-test
@@ -95,7 +92,7 @@ functions:
9592
MCLI_PRIVATE_API_KEY: ${cloud_manager_private_api_key}
9693
MCLI_PUBLIC_API_KEY: ${cloud_manager_public_api_key}
9794
MCLI_SERVICE: cloud-manager
98-
E2E_CMD: gotestsum --junitfile e2e-tests.xml --
95+
TEST_CMD: gotestsum --junitfile e2e-tests.xml --
9996
E2E_TAGS: e2e,cloudmanager
10097
<<: *go_options
10198
command: make e2e-test
@@ -105,9 +102,7 @@ functions:
105102
params:
106103
working_dir: src/github.com/mongodb/mongocli
107104
script: |
108-
set -o xtrace
109-
set -o errexit
110-
set -o verbose
105+
set -Eeou pipefail
111106
112107
export GOROOT="${go_root}"
113108
export PATH="./bin:$GOROOT/bin:$PATH"
@@ -118,11 +113,9 @@ functions:
118113
params:
119114
working_dir: src/github.com/mongodb/mongocli/bin
120115
script: |
121-
set -o xtrace
122-
set -o errexit
123-
set -o verbose
116+
set -Eeou pipefail
124117
125-
curl -sfL https://github.com/gotestyourself/gotestsum/releases/download/v0.4.2/gotestsum_0.4.2_linux_amd64.tar.gz | tar zx
118+
curl -sfL https://github.com/gotestyourself/gotestsum/releases/download/v${gotestsum_ver}/gotestsum_${gotestsum_ver}_linux_amd64.tar.gz | tar zx
126119
"install golangci-lint":
127120
- command: subprocess.exec
128121
type: setup
@@ -135,20 +128,16 @@ functions:
135128
params:
136129
working_dir: src/github.com/mongodb/mongocli/bin
137130
script: |
138-
set -o xtrace
139-
set -o errexit
140-
set -o verbose
131+
set -Eeou pipefail
141132
142-
curl -sL https://github.com/mitchellh/gon/releases/download/v0.2.3/gon_macos.zip | tar zx
133+
curl -sL https://github.com/mitchellh/gon/releases/download/v${gon_ver}/gon_macos.zip | tar zx
143134
"install goreleaser":
144135
- command: shell.exec
145136
type: setup
146137
params:
147138
working_dir: src/github.com/mongodb/mongocli
148139
script: |
149-
set -o xtrace
150-
set -o errexit
151-
set -o verbose
140+
set -Eeou pipefail
152141
153142
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
154143
"install curator":
@@ -157,9 +146,7 @@ functions:
157146
params:
158147
working_dir: src/github.com/mongodb/mongocli
159148
script: |
160-
set -o xtrace
161-
set -o errexit
162-
set -o verbose
149+
set -Eeou pipefail
163150
164151
curl -sL http://boxes.10gen.com/build/curator/curator-dist-rhel70-${curator_release|"latest"}.tar.gz | tar zx
165152
"set up gon":
@@ -225,9 +212,7 @@ functions:
225212
params:
226213
working_dir: src/github.com/mongodb/mongocli
227214
script: |
228-
set -o errexit
229-
set -o xtrace
230-
set -o verbose
215+
set -Eeou pipefail
231216
# notarization and signing can only happen in a session with access to the GUI, so we use ssh to it
232217
ssh -v -p 2222 localhost "bash ~/mongocli_package.sh"
233218
"install go-msi":
@@ -248,9 +233,7 @@ functions:
248233
params:
249234
working_dir: src/github.com/mongodb/mongocli
250235
script: |
251-
set -o xtrace
252-
set -o errexit
253-
set -o verbose
236+
set -Eeou pipefail
254237
255238
export GOROOT="${go_root}"
256239
export GOCACHE="$(cygpath --mixed "${workdir}\.gocache")"
@@ -273,9 +256,7 @@ functions:
273256
params:
274257
working_dir: src/github.com/mongodb/mongocli/dist
275258
script: |
276-
set -o xtrace
277-
set -o errexit
278-
set -o verbose
259+
set -Eeou pipefail
279260
280261
VERSION=$(git describe --abbrev=0 | cut -d "v" -f 2)
281262
FILENAME=mongocli_"$VERSION"_linux_x86_64
@@ -295,9 +276,7 @@ functions:
295276
params:
296277
working_dir: src/github.com/mongodb/mongocli/dist
297278
script: |
298-
set -o xtrace
299-
set -o errexit
300-
set -o verbose
279+
set -Eeou pipefail
301280
302281
export GOROOT="${go_root}"
303282
export PATH="./bin:${go_bin}:$PATH"
@@ -330,9 +309,7 @@ functions:
330309
script: |
331310
. ./notary_env.sh
332311
333-
set -o xtrace
334-
set -o errexit
335-
set -o verbose
312+
set -Eeou pipefail
336313
337314
# --version needs to match the mongodb server version to publish to the right repo
338315
# 4.X goes to the 4.x repo

0 commit comments

Comments
 (0)