-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path.evg.yml
379 lines (367 loc) · 12.8 KB
/
.evg.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
functions:
"fetch_source":
- command: git.get_project
params:
directory: "stitch-ios-sdk"
"setup_swiftlint":
- command: shell.exec
params:
script: |
set -e
export DEVELOPER_DIR=/Applications/Xcode10.2.app
mkdir -p SwiftLint
pushd SwiftLint
curl -o swiftlint.zip -L https://github.com/realm/SwiftLint/releases/download/0.29.1/portable_swiftlint.zip
unzip swiftlint.zip
popd
"setup_mongod":
- command: shell.exec
params:
script: |
set -e
curl --silent ${mongodb_url} | tar xz
cd mongodb-*
mkdir db_files
"run_mongod":
- command: shell.exec
params:
background: true
script: |
set -e
cd mongodb-*
echo "starting mongod..."
./bin/mongod --dbpath ./db_files --port 26000 --replSet test
- command: shell.exec
params:
script: |
set -e
cd mongodb-*
echo "waiting for mongod to start up"
./bin/mongo --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:26000"); return true}catch(e){return false}}, "timed out connecting")'
./bin/mongo --port 26000 --eval 'rs.initiate()'
echo "mongod is up."
"setup_stitch":
- command: shell.exec
params:
script: |
set -e
echo "cloning stitch"
git clone [email protected]:10gen/stitch
echo "downloading update_doc"
curl --silent -O "https://s3.amazonaws.com/stitch-artifacts/stitch-mongo-libs/stitch_mongo_libs_osx_patch_cbcbfd8ebefcca439ff2e4d99b022aedb0d61041_59e2b7a5c9ec4432c400181c_17_10_15_01_19_33/update_doc"
echo "downloading assisted_agg"
curl --silent -O "https://s3.amazonaws.com/stitch-artifacts/stitch-mongo-libs/stitch_mongo_libs_osx_patch_cbcbfd8ebefcca439ff2e4d99b022aedb0d61041_59e2b7ab2a60ed5647001827_17_10_15_01_19_39/assisted_agg"
chmod +x update_doc
chmod +x assisted_agg
mkdir -p stitch/etc/dylib
cd stitch/etc/dylib
curl -s "${server_stitch_lib_url}" | tar xvfz - --strip-components=1
cd -
echo "building transpiler"
cd stitch/etc/transpiler
curl -O "https://nodejs.org/dist/v8.11.2/node-v8.11.2-darwin-x64.tar.gz"
tar zxf node-v8.11.2-darwin-x64.tar.gz
export PATH=`pwd`/node-v8.11.2-darwin-x64/bin/:$PATH
rm -rf $HOME/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn install && yarn run build -t ${transpiler_target}
- command: shell.exec
params:
background: true
script: |
set -e
export ROOT_DIR=`pwd`
export PATH=$ROOT_DIR/:$PATH
curl --silent https://dl.google.com/go/go1.13.darwin-amd64.tar.gz | tar xz
export GOROOT=$ROOT_DIR/go
export PATH=$GOROOT/bin:$PATH
export STITCH_PATH=$ROOT_DIR/stitch
export PATH="$PATH:$STITCH_PATH/etc/transpiler/bin"
export LD_LIBRARY_PATH="$STITCH_PATH/etc/dylib/lib"
echo "running stitch"
# TODO: Probably better to get an API key added to mimic cloud
cd $STITCH_PATH
go run cmd/auth/user.go addUser -domainID 000000000000000000000000 -mongoURI mongodb://localhost:26000 -salt 'DQOWene1723baqD!_@#' -id "[email protected]" -password "password"
"run_stitch":
- command: shell.exec
params:
background: true
script: |
export ROOT_DIR=`pwd`
export PATH=$ROOT_DIR/:$PATH
export GOROOT=$ROOT_DIR/go
export PATH=$GOROOT/bin:$PATH
export STITCH_PATH=$ROOT_DIR/stitch
export PATH="$PATH:$STITCH_PATH/etc/transpiler/bin"
export LD_LIBRARY_PATH="$STITCH_PATH/etc/dylib/lib"
cd $STITCH_PATH
go run cmd/server/main.go --configFile $STITCH_PATH/etc/configs/test_config.json
- command: shell.exec
params:
script: |
counter=0
until $(curl --output /dev/null --silent --head --fail http://localhost:9090); do
echo "checking for API server to be up..."
sleep 1
let counter++
if [ $counter -gt 100 ]; then
exit 1
fi
done
"clear_disk_space":
- command: shell.exec
params:
script: |
rm -rf /Users/mci/Library/Developer/Xcode/DerivedData/
rm -rf /Users/mci/Library/Caches/go-build
export DEVELOPER_DIR=/Applications/Xcode10.2.app
xcrun simctl delete __stitch__
"setup_ios":
- command: shell.exec
params:
silent: true
script: |
set -e
export DEVELOPER_DIR=/Applications/Xcode10.2.app
if pgrep CoreSimulator; then pkill -9 CoreSimulator; fi
echo export AWS_ACCESS_KEY_ID=${test_aws_key} >> creds
echo export AWS_SECRET_ACCESS_KEY=${test_aws_secret} >> creds
echo export TWILIO_SID=${test_twilio_sid} >> creds
echo export TWILIO_AUTH_TOKEN=${test_twilio_authtoken} >> creds
echo export FCM_SENDER_ID=${test_fcm_sender_id} >> creds
echo export FCM_API_KEY=${test_fcm_api_key} >> creds
echo export PERF_IOS_API_KEY=${perf_ios_api_key} >> creds
echo export COVERALLS_TOKEN=${coveralls_repo_token} >> creds
SID=`python stitch-ios-sdk/etc/read_ios_runtime.py`
echo export SIM_ID=$SID >> creds
"setup_pods":
- command: shell.exec
params:
script: |
set -e
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
export GEM_HOME=`pwd`
export GEM_PATH=`pwd`
/opt/chef/embedded/bin/gem install cocoapods -v 1.7.3 --install-dir ./
bin/pod install --repo-update || (rm -rf ~/.cocoapods/repos && bin/pod install --repo-update)
tasks:
- name: lint
commands:
- func: "fetch_source"
- func: "setup_swiftlint"
- command: shell.exec
params:
script: |
set -e
export DEVELOPER_DIR=/Applications/Xcode10.2.app
pushd SwiftLint
export PATH=`pwd`:$PATH
popd
cd stitch-ios-sdk
contrib/lint_projects.sh
- name: run_core_sdk_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "All Core Tests" \
-destination id=$SIM_ID
- name: run_ios_core_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchCore" \
-destination id=$SIM_ID
- name: run_ios_services_mongodb_remote_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchRemoteMongoDBService" \
-destination id=$SIM_ID
- name: run_ios_services_aws_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchAWSService" \
-destination id=$SIM_ID \
GCC_PREPROCESSOR_DEFINITIONS='AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY'
- name: run_ios_services_fcm_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchFCMService" \
-destination id=$SIM_ID \
GCC_PREPROCESSOR_DEFINITIONS='FCM_SENDER_ID=$FCM_SENDER_ID FCM_API_KEY=$FCM_API_KEY'
- name: run_ios_services_http_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchHTTPService" \
-destination id=$SIM_ID
- name: run_ios_services_mongodb_local_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchLocalMongoDBService" \
-destination id=$SIM_ID
- name: run_ios_services_twilio_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchTwilioService" \
-destination id=$SIM_ID \
GCC_PREPROCESSOR_DEFINITIONS='TWILIO_SID=$TWILIO_SID TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN'
- name: run_ios_services_mongodb_remote_performance_tests
commands:
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export DEVELOPER_DIR=/Applications/Xcode10.2.app
cd stitch-ios-sdk
xcodebuild test \
-verbose \
-workspace Stitch.xcworkspace/ \
-scheme "StitchSyncPerformanceTests" \
-destination id=$SIM_ID \
GCC_PREPROCESSOR_DEFINITIONS='PERF_IOS_API_KEY=$PERF_IOS_API_KEY PERF_IOS_STITCH_HOST=prod PERF_IOS_HOSTNAME=Evergreen PERF_IOS_DOC_SIZES=11-22 PERF_IOS_NUM_DOCS=100-200 PERF_IOS_NUM_ITERS=1'
task_groups:
- name: run_core_tests
setup_group_can_fail_task: true
max_hosts: 1
setup_group:
- func: "fetch_source"
- func: "setup_ios"
- func: "setup_pods"
tasks:
- run_core_sdk_tests
teardown_group:
- func: "clear_disk_space"
- name: run_ios_tests
setup_group_can_fail_task: true
max_hosts: 3
setup_group:
- func: "fetch_source"
- func: "setup_mongod"
- func: "run_mongod"
- func: "setup_stitch"
- func: "setup_ios"
- func: "setup_pods"
setup_task:
- func: "run_mongod"
- func: "run_stitch"
tasks:
- run_ios_core_tests
- run_ios_services_mongodb_remote_tests
- run_ios_services_aws_tests
- run_ios_services_fcm_tests
- run_ios_services_http_tests
- run_ios_services_mongodb_local_tests
- run_ios_services_twilio_tests
teardown_group:
- func: "clear_disk_space"
- name: run_ios_performance_tests
setup_group_can_fail_task: true
max_hosts: 1
setup_group:
- func: "fetch_source"
- func: "setup_mongod"
- func: "run_mongod"
- func: "setup_stitch"
- func: "setup_ios"
- func: "setup_pods"
setup_task:
- func: "run_mongod"
- func: "run_stitch"
tasks:
- run_ios_services_mongodb_remote_performance_tests
teardown_group:
- func: "clear_disk_space"
buildvariants:
- name: macos-1014
display_name: macos-1014
run_on:
- macos-1014
expansions:
mongodb_url: http://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-4.0.2.tgz
transpiler_target: node8-macos
server_stitch_lib_url: 'https://s3.amazonaws.com/mciuploads/mongodb-mongo-master/stitch-support/osx-1010/80f9a13324fc36b2deb400e5a185968f6fa8f64a/stitch-support-4.1.7-319-g80f9a13324.tgz'
tasks:
- name: run_core_tests
- name: run_ios_tests
- name: lint