forked from tolsen/mongonet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.evergreen.yml
161 lines (144 loc) · 3.88 KB
/
.evergreen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
stepback: true
command_type: system
functions:
"fetch source":
- command: git.get_project
params:
directory: mongonet
- command: git.apply_patch
params:
directory: mongonet
"fetch mongodb":
- command: shell.exec
params:
working_dir: mongonet
script: |
set -vx
rm -rf mongodb
mkdir -p mongodb/bin
cd mongodb
curl ${mongo_url} -o mongodb.tgz
${decompress} mongodb.tgz
chmod +x ./mongodb-*/bin/*
mv ./mongodb-*/bin/* ./bin
"run unit tests":
- command: shell.exec
params:
working_dir: mongonet
script: |
set -euvx
${gorootvars}
export GOPATH=`pwd`/.gopath
go test -test.v > unittest.suite
exitcode=$?
cat unittest.suite
exit $exitcode
"run integration tests mongod mode":
- command: shell.exec
params:
working_dir: mongonet
script: |
set -euvx
${gorootvars}
export GOPATH=`pwd`/.gopath
export MONGO_DIR=`pwd`/mongodb/bin
export PATH=$PATH:$MONGO_DIR
go version
cd inttests
sh ./run_integration_tests_mongod_mode.sh
"run integration tests mongos mode":
- command: shell.exec
params:
working_dir: mongonet
script: |
set -euvx
${gorootvars}
export GOPATH=`pwd`/.gopath
export MONGO_DIR=`pwd`/mongodb/bin
export PATH=$PATH:$MONGO_DIR
go version
cd inttests
sh ./run_integration_tests_mongos_mode.sh
"run go vet":
- command: shell.exec
params:
working_dir: mongonet
script: |
set -euvx
export GOPATH=`pwd`/.gopath
${gorootvars} go version
${gorootvars} go vet --composites=false ./...
exitcode=$?
exit $exitcode
"check go fmt":
- command: shell.exec
params:
working_dir: mongonet
script: |
set -euvx
${gorootvars} go version
export files_needing_formatting=`${gorootvars} gofmt -l -s -w .`
echo 'FILES NEEDING FORMATTING:'
for i in $files_needing_formatting; do echo $i; done
echo
test `echo $files_needing_formatting | wc -w` = '0'
exit $?
tasks:
- name: RunUnitTests
priority: 5
commands:
- func: "fetch source"
- func: "fetch mongodb"
- func: "run unit tests"
- name: RunIntegrationTestsMongosMode
priority: 5
commands:
- func: "fetch source"
- func: "fetch mongodb"
- func: "run integration tests mongos mode"
- name: RunIntegrationTestsMongodMode
priority: 5
commands:
- func: "fetch source"
- func: "fetch mongodb"
- func: "run integration tests mongod mode"
- name: CheckGoFmt
commands:
- func: "fetch source"
- func: "check go fmt"
- name: GoVet
commands:
- func: "fetch source"
- func: "run go vet"
post:
- command: gotest.parse_files
params:
files: ["mongonet/unittest.suite"]
buildvariants:
- name: rhel7
display_name: RHEL 7
expansions:
mongo_url: https://downloads.mongodb.com/linux/mongodb-linux-x86_64-enterprise-rhel70-4.4.1.tgz
gorootvars: export PATH="/opt/golang/go1.14/bin:$PATH" GOROOT=/opt/golang/go1.14
run_on:
- rhel70
tasks:
- "RunUnitTests"
- "RunIntegrationTestsMongosMode"
- "RunIntegrationTestsMongodMode"
- name: check-go-fmt
display_name: Check go fmt (linux)
run_on:
- amazon1-2018-test
expansions:
gorootvars: PATH="/opt/golang/go1.14/bin:$PATH" GOROOT=/opt/golang/go1.14
tasks:
- "CheckGoFmt"
- name: linux-go-vet
display_name: go vet (Linux)
run_on:
- rhel70
expansions:
gorootvars: PATH="/opt/golang/go1.14/bin:$PATH" GOROOT=/opt/golang/go1.14
tasks:
- "GoVet"