summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/.evergreen.yml
blob: 43535b8124ec6e89f1a10bfc10817cda346749c1 (plain)
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
functions:
  "fetch source" :
    - command: git.get_project
      params:
        directory: src
    - command: git.apply_patch
      params:
        directory: src

  "build tool" :
    command: shell.exec
    params:
      working_dir: src
      script: |
        echo "Building ${tool}..."
        . ./set_gopath.sh
        go build ${args} -o bin/${tool} cmd/${tool}/main.go

  "upload archive" :
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: src/${filename}
      remote_file: mongotape/archive/${build_id}/${filename}
      bucket: mciuploads
      permissions: public-read
      content_type: application/gzip
      display_name: ${filename}

  "create timeseries" :
    command: shell.exec
    params:
      working_dir: src
      script: |
        git clone git@github.com:10gen/support-tools
        sudo pip install argparse python-dateutil pytz
        python support-tools/timeseries/timeseries.py /data/mongotape/diagnostic.data --html timeseries.html

  "upload timeseries" :
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: src/timeseries.html
      remote_file: mongotape/timeseries/${build_id}/timeseries.html
      bucket: mciuploads
      permissions: public-read
      content_type: text/html
      display_name: timeseries.html

  "upload tool" :
    command: s3.put
    params:
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: src/bin/${tool}
      remote_file: mongotape/binaries/${build_id}/${tool}
      bucket: mciuploads
      permissions: public-read
      content_type: application/octet-stream
      display_name: ${tool} binary

  "fetch tool" :
    command: s3.get
    params:
      bucket: mciuploads
      aws_key: ${aws_key}
      aws_secret: ${aws_secret}
      local_file: src/${tool}
      remote_file: mongotape/binaries/${build_id}/${tool}

  "fetch pcap" :
      command: s3.get
      params:
        bucket: boxes.10gen.com
        aws_key: ${aws_key}
        aws_secret: ${aws_secret}
        local_file: src/testPcap/${pcapFname}
        remote_file: build/mongotape/${pcapFname}

  "fetch ftdc" :
  - command: shell.exec
    type: test
    params:
      working_dir: src
      script: |
        . ./set_gopath.sh
        go get github.com/10gen/ftdc-utils/cmd/ftdc

  "start mongod" :
    - command: shell.exec
      params:
        background: true
        script: |
          set -e
          set -o verbose
          cd mongodb
          echo "starting mongodb"
          mkdir -p ./mongotape_test
          ./mongod --dbpath ./mongotape_test --port=${mongod_port} ${additional_args} &
    - command: shell.exec
      params:
        script: |
          set -e
          set -o verbose
          cd mongodb 
          ./mongo --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:${mongod_port}"); return true}catch(e){return false}}, "timed out connecting")'

  "fetch mongodb" :
  - command: shell.exec
    params:
      script: |
        rm -rf mongodb
        mkdir mongodb
        cd mongodb
        curl ${mongo_url} -o mongodb.tgz
        ${decompress} mongodb.tgz
        chmod +x ./mongodb-*/bin/*
        mv ./mongodb-*/bin/* .
        rm -rf db_files
        rm -rf db_logs
        mkdir db_files
        mkdir db_logs

  "create auth_user" :
  - command: shell.exec
    params:
      script: |
              set -e
              set -o verbose
              cd mongodb
              ./mongo --port ${mongod_port} admin --eval "db.createUser({user:\"authorizedUser\", pwd: \"authorizedPwd\", roles:[\"readWriteAnyDatabase\", \"clusterManager\"]});"

  "create sharded_cluster" :
    - command: shell.exec
      params:
        background: true
        script: |
          set -e
          set -o verbose
          cd mongodb
          echo "starting mongodb"
          mkdir -p /data/db/
          ./mongo --nodb --eval 'var d = new ShardingTest({shards:3, mongos:[{port:${mongod_port}}]}); while(true){sleep(1000)}' 
    - command: shell.exec
      params:
        script: |
          set -e
          set -o verbose
          cd mongodb 
          ./mongo --nodb --eval 'var d; assert.soon(function(x){try{d = new Mongo("localhost:${mongod_port}"); return true} catch(e){return false}}, "timed out connection");d.setLogLevel(5, "write");'

  "create repl_set" :
    - command: shell.exec
      params:
        background: true
        script: |
          set -e
          set -o verbose
          cd mongodb
          echo "starting mongodb"
          mkdir -p /data/db/
          ./mongo --nodb --eval 'var repl = new ReplSetTest({nodes:3, startPort:${mongod_port}});repl.startSet();repl.initiate();repl.awaitSecondaryNodes();while(true){sleep(1000);}'
    - command: shell.exec
      params:
        script: |
          set -e
          set -o verbose
          cd mongodb 
          ./mongo --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:${mongod_port}"); return true} catch(e){return false}}, "timed out connection")'

  "run go_test" :
  - command: shell.exec
    type: test
    params:
      working_dir: src
      script: |
        . ./set_gopath.sh
        ${environment_vars} go test ${additional_args} -v > ${filename}.suite

pre:
  - command: shell.track

post:
  - command: shell.exec
  - command: gotest.parse_files
    params:
      files: ["src/*.suite"]
  - command: shell.cleanup

tasks:
- name: replay-dist
  commands:
  - func: "fetch source"
  - func: "build tool"
    vars:
      tool: mongotape
  - func: "upload tool"
    vars:
      tool: mongotape
  - func: "build tool"

- name: replay-sanity_check
  depends_on:
  - name: replay-dist
  commands:
  - func: "fetch source"
  - func: "fetch tool"
    vars:
      tool: mongotape
  - func: "fetch mongodb"
  - func: "start mongod"
  - command: shell.exec
    params:
      working_dir: src
      script: |
        set -e
        chmod +x mongotape
        PATH=$PATH:`pwd`:`pwd`/../mongodb
        echo "Running sanity check"
        ./sanity_check.sh -p ${mongod_port}

- name: replay-go_test
  depends_on:
  - name: replay-dist
  commands:
  - func: "fetch source"
  - func: "fetch tool"
    vars:
      tool: mongotape
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_multi_channel.pcap
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_single_channel.pcap
  - func: "fetch mongodb"
  - func: "start mongod"
    vars:
        mongod_port: 20000
  - func: "run go_test"
    vars:
        filename: playtest

- name: replay-sharded_test
  depends_on:
  - name: replay-dist
  commands:
  - func: "fetch source"
  - func: "fetch tool"
    vars:
      tool: mongotape
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_multi_channel.pcap
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_single_channel.pcap
  - func: "fetch mongodb"
  - func: "create sharded_cluster"
    vars:
        mongod_port: 20010
  - func: "run go_test"
    vars:
        filename: sharded
        environment_vars: DB_PORT=20010
        additional_args: --run "LiveDB"

- name: replay-auth_test
  depends_on:
  - name: replay-dist
  commands:
  - func: "fetch source"
  - func: "fetch tool"
    vars:
      tool: mongotape
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_multi_channel.pcap
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_single_channel.pcap
  - func: "fetch mongodb"
  - func: "start mongod"
    vars:
        mongod_port: 20000
        additional_args: --auth
  - func: "create auth_user"
    vars:
        mongod_port: 20000
  - func: "run go_test"
    vars:
        environment_vars: AUTH=1
        filename: authtest
        additional_args: --run "(LiveDB)|(Authed)"

- name: replay-repl_test
  depends_on:
  - name: replay-dist
  commands:
  - func: "fetch source"
  - func: "fetch tool"
    vars:
      tool: mongotape
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_multi_channel.pcap
  - func: "fetch pcap"
    vars:
      pcapFname: getmore_single_channel.pcap
  - func: "fetch mongodb"
  - func: "create repl_set"
    vars:
      mongod_port: 20000
  - func: "run go_test"
    vars:
        filename: repltest
        additional_args: --run "LiveDB"

- name: replay-replay_test
  depends_on:
  - name: replay-dist
  commands:
  - func: "fetch source"
  - func: "fetch tool"
    vars:
      tool: mongotape
  - func: "fetch mongodb"
  - func: "fetch ftdc"
  - command: shell.exec
    params:
      working_dir: src
      script: |
        set -e
        . ./set_gopath.sh
        PATH=$PATH:`pwd`:`pwd`/vendor/bin:`pwd`/../mongodb
        chmod +x mongotape
        echo "Running replay test"
        ./replay_test.sh --verbose --explicit --keep
  - command: shell.exec
    params:
      working_dir: src
      script: |
        tar czf replay.tar.gz tmp.*
  - func: "upload archive"
    vars:
      filename: replay.tar.gz
  - func: "create timeseries"
  - func: "upload timeseries"

buildvariants:
- name: ubuntu
  display_name: Ubuntu
  expansions:
    mongod_port: 27017
    mongo_url: http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.4.tgz
  run_on:
  - ubuntu1404-test
  tasks:
  - name: replay-dist
  - name: replay-sanity_check
  - name: replay-go_test
  - name: replay-auth_test
  - name: replay-sharded_test
  - name: replay-repl_test
  - name: replay-replay_test