Skip to content

Commit cc4c7eb

Browse files
author
Divjot Arora
authored
Extend Evergreen build tasks to also compile tests (#398)
1 parent 9358b40 commit cc4c7eb

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.evergreen/config.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ functions:
251251
working_dir: src/go.mongodb.org/mongo-driver
252252
script: |
253253
${PREPARE_SHELL}
254-
${BUILD_ENV|} make ${targets} BUILD_TAGS="-tags cse,gssapi"
254+
${BUILD_ENV|} make ${targets} BUILD_TAGS="-tags \"cse gssapi\""
255255
256256
run-tests:
257257
- command: shell.exec
@@ -1385,31 +1385,39 @@ tasks:
13851385
commands:
13861386
- func: run-make
13871387
vars:
1388-
targets: "build"
1388+
targets: "build build-tests"
13891389
BUILD_ENV: "PATH=/opt/golang/go1.10/bin:$PATH GOROOT=/opt/golang/go1.10"
13901390

1391+
# Build with whatever the latest Go version is that we're using for tests
1392+
- name: build
1393+
tags: ["compile-check"]
1394+
commands:
1395+
- func: run-make
1396+
vars:
1397+
targets: "build build-tests"
1398+
13911399
- name: linux-32-bit
13921400
tags: ["compile-check"]
13931401
commands:
13941402
- func: run-make
13951403
vars:
1396-
targets: "build"
1404+
targets: "build-no-tags"
13971405
BUILD_ENV: "GOARCH=386"
13981406

13991407
- name: linux-arm64
14001408
tags: ["compile-check"]
14011409
commands:
14021410
- func: run-make
14031411
vars:
1404-
targets: "build"
1412+
targets: "build-no-tags"
14051413
BUILD_ENV: "GOARCH=arm64"
14061414

14071415
- name: linux-s390x
14081416
tags: ["compile-check"]
14091417
commands:
14101418
- func: run-make
14111419
vars:
1412-
targets: "build"
1420+
targets: "build-no-tags"
14131421
BUILD_ENV: "GOARCH=ppc64le"
14141422

14151423
- name: "atlas-test"
@@ -1431,14 +1439,6 @@ tasks:
14311439
- func: run-aws-auth-test-with-aws-EC2-credentials
14321440
- func: run-aws-ECS-auth-test
14331441

1434-
- name: go1.10-build-cse
1435-
tags: ["compile-check"]
1436-
commands:
1437-
- func: run-make
1438-
vars:
1439-
targets: "build-cse"
1440-
BUILD_ENV: "PATH=/opt/golang/go1.10/bin:$PATH GOROOT=/opt/golang/go1.10"
1441-
14421442
axes:
14431443
- id: version
14441444
display_name: MongoDB Version

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ debug
1010
driver-test-data.tar.gz
1111
perf
1212
**mongocryptd.pid
13+
*.test

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@ build-examples:
3131

3232
.PHONY: build
3333
build:
34+
go build $(BUILD_TAGS) $(filter-out ./core/auth/internal/gssapi,$(PKGS))
35+
36+
.PHONY: build-no-tags
37+
build-no-tags:
3438
go build $(filter-out ./core/auth/internal/gssapi,$(PKGS))
3539

36-
.PHONY: build-cse
37-
build-cse:
38-
go build -tags cse $(filter-out ./core/auth/internal/gssapi,$(PKGS))
40+
.PHONY: build-tests
41+
build-tests:
42+
for TEST in $(PKGS); do \
43+
go test $(BUILD_TAGS) -c $$TEST ; \
44+
if [ $$? -ne 0 ]; \
45+
then \
46+
exit 1; \
47+
fi \
48+
done
3949

4050
.PHONY: check-fmt
4151
check-fmt:

0 commit comments

Comments
 (0)