-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
Copy pathconfig.yml
344 lines (333 loc) · 11.7 KB
/
config.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
version: 2
jobs:
litmus_daily:
machine: true
steps:
- attach_workspace:
at: ~/project
- run: docker login -u=$QUAY_USER -p=$QUAY_PASS quay.io
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e ONE_TEST=src/cloud/rest_api/smoke/test_smoke.py -e BINARYPATH=/Litmus/result/bin/linux/influxd -e BOLTPATH=/Litmus/result/influxd_test/influxd.bolt -e ENGINEPATH=/Litmus/result/influxd_test --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
- run:
name: Litmus Smoke Tests Success
when: on_success
command: bash ~/project/etc/litmus_success_notify.sh Smoke
path: ~/project
- run:
name: Litmus Smoke Tests Fail
when: on_fail
command: bash ~/project/etc/litmus_fail_notify.sh Smoke
- store_artifacts:
path: ~/project
destination: raw-daily-output
- store_test_results:
path: ~/project
destination: daily-junit
litmus_nightly:
machine: true
steps:
- attach_workspace:
at: ~/project
- run: docker login -u=$QUAY_USER -p=$QUAY_PASS quay.io
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e TEST_LIST=tests_lists/gateway_api_tests.list -e DOCKERIMAGE=true --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
- run:
name: Litmus Nightly Tests Success
when: on_success
command: bash ~/project/etc/litmus_success_notify.sh Nightly
- run:
name: Litmus Nightly Tests Fail
when: on_fail
command: bash ~/project/etc/litmus_fail_notify.sh Nightly
- store_artifacts:
path: ~/project
destination: raw-nightly-output
- store_test_results:
path: ~/project
destination: nightly-junit
e2e:
docker:
- image: circleci/golang:1.12-node-browsers
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: '-mod=readonly -p=4' # Go on Circle thinks 32 CPUs are available, but there aren't.
working_directory: /go/src/github.com/influxdata/influxdb
steps:
- checkout
# Speed up `make build` by restoring caches from previous runs.
- restore_cache:
name: Restoring GOCACHE
keys:
- influxdb-gocache- # Just match the most recent Go cache.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
- run: sudo apt-get install -y netcat-openbsd
- run: sudo apt-get install -y bzr
- run: make protoc
- run: make build
- run:
command: ./bin/linux/influxd --store=memory --e2e-testing=true
background: true
- run: make e2e
- store_test_results:
path: ui/junit-results
destination: junit-results
- store_artifacts:
path: ui/cypress/videos
destination: videos
- store_artifacts:
path: ui/cypress/screenshots
destination: screenshots
selenium_accept:
docker:
- image: circleci/node:13.0.1-stretch-browsers
- image: quay.io/influxdb/influx:nightly
command: [ --e2e-testing=true ]
steps:
- checkout
- run:
name: Environment check
command: |
git --version
node --version && npm --version
docker --version
google-chrome --version && which google-chrome && chromedriver --version && which chromedriver
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9999)" != "200" ]]; do sleep 5; done' || false
- run:
name: Checkout Tests
command: git clone --single-branch --branch 2.0-Alpha https://github.com/bonitoo-io/selenium-accept-infl2.git
- run:
name: Selenium tests
command: |
set +e
cd selenium-accept-infl2
npm install
npm test; TEST_RESULT=$?
npm run report:html
npm run report:junit
mkdir -p ~/test-results/cucumber
mkdir -p ~/artifacts/html
cp ~/project/selenium-accept-infl2/report/cucumber_report.html ~/artifacts/html/cucumber_report.html
cp ~/project/selenium-accept-infl2/report/cucumber_junit.xml ~/test-results/cucumber/report.xml
cp ~/project/selenium-accept-infl2/report/cucumber_junit.xml ~/artifacts/report.xml
cp -r ~/project/selenium-accept-infl2/screenshots ~/artifacts
ls -al
exit $TEST_RESULT
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/artifacts
jstest:
docker:
- image: circleci/golang:1.12-node-browsers
working_directory: /go/src/github.com/influxdata/influxdb
steps:
- checkout
- run: make node_modules
- run: make ui_client
- run: make test-js
- run: make chronograf_lint
gotest:
docker:
- image: circleci/golang:1.12
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: '-mod=readonly -p=2' # Go on Circle thinks 32 CPUs are available, but there aren't.
TEST_RESULTS: /tmp/test-results
working_directory: /go/src/github.com/influxdata/influxdb
steps:
- checkout
# Populate GOCACHE.
- restore_cache:
name: Restoring GOCACHE
keys:
- influxdb-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run.
- influxdb-gocache-{{ .Branch }}- # Matches a new commit on an existing branch.
- influxdb-gocache- # Matches a new branch.
# Populate GOPATH/pkg.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
- influxdb-gomod-{{ checksum "go.sum" }} # Matches based on go.sum checksum.
- run: sudo apt-get install -y bzr
- run: mkdir -p $TEST_RESULTS
- run: make test-go # This uses the test cache so it may succeed or fail quickly.
- run: make vet
- run: make checkfmt
- run: make checktidy
- run: GO111MODULE=on go mod vendor # staticcheck looks in vendor for dependencies.
- run: GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck # Install staticcheck from the version we specify in go.mod.
- run: GO111MODULE=on staticcheck ./...
- run: GOTRACEBACK=all GO111MODULE=on gotestsum --format standard-verbose --junitfile /tmp/test-results/gotestsum.xml -- -race -count=1 ./...
# TODO add these checks to the Makefile
# - run: go get -v -t -d ./...
- save_cache:
name: Saving GOCACHE
key: influxdb-gocache-{{ .Branch }}-{{ .Revision }}
paths:
- /tmp/go-cache
when: always
- save_cache:
name: Saving GOPATH/pkg/mod
key: influxdb-gomod-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod
when: always
- store_artifacts: # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
path: /tmp/test-results
destination: raw-test-output
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: /tmp/test-results
build:
docker:
- image: circleci/golang:1.12-node-browsers
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: '-mod=readonly -p=4' # Go on Circle thinks 32 CPUs are available, but there aren't.
working_directory: /go/src/github.com/influxdata/influxdb
steps:
- checkout
- run: sudo apt-get install -y bzr
- run: make checkcommit
# Speed up `make build` by restoring caches from previous runs.
- restore_cache:
name: Restoring GOCACHE
keys:
- influxdb-gocache- # Just match the most recent Go cache.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
- run: make protoc
- run: make build
- persist_to_workspace:
root: .
paths:
- project
- bin/linux/influxd
- bin/linux/influx
- etc/litmus_success_notify.sh
- etc/litmus_fail_notify.sh
deploy-nightly:
docker:
- image: circleci/golang:1.12-node-browsers
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: '-mod=readonly -p=4' # Go on Circle thinks 32 CPUs are available, but there aren't.
working_directory: /go/src/github.com/influxdata/influxdb
steps:
- checkout
# Speed up `make nightly` by restoring caches from previous runs.
- restore_cache:
name: Restoring GOCACHE
keys:
- influxdb-gocache- # Just match the most recent Go cache.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
- setup_remote_docker
- run:
name: 'Docker Login'
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
- run: sudo apt-get install -y bzr
- run: make protoc # installs protoc
- run:
name: 'Build nightly'
command: make nightly
- persist_to_workspace:
root: .
paths:
- etc/litmus_success_notify.sh
- etc/litmus_fail_notify.sh
release:
docker:
- image: circleci/golang:1.12-node-browsers
environment:
GOCACHE: /tmp/go-cache
GOFLAGS: '-mod=readonly -p=4' # Go on Circle thinks 32 CPUs are available, but there aren't.
DOCKER_VERSION: 2.0.0-alpha
working_directory: /go/src/github.com/influxdata/influxdb
steps:
- checkout
# Speed up `make nightly` by restoring caches from previous runs.
- restore_cache:
name: Restoring GOCACHE
keys:
- influxdb-gocache- # Just match the most recent Go cache.
- restore_cache:
name: Restoring GOPATH/pkg/mod
keys:
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
- setup_remote_docker
- run:
name: 'Docker Login'
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
- run: sudo apt-get install -y bzr
- run: make protoc # installs protoc
- run:
name: 'Build release'
command: make release
workflows:
version: 2
build:
jobs:
- gotest
- jstest
- build
- litmus_daily:
requires:
- build
filters:
branches:
only: /^(?!pull\/).*$/
e2e:
jobs:
- e2e
nightly:
triggers:
- schedule:
cron: '0 7 * * *'
filters:
branches:
only:
- master
jobs:
- gotest
- jstest
- deploy-nightly:
requires:
- gotest
- jstest
filters:
branches:
only: master
- litmus_nightly:
requires:
- deploy-nightly
- selenium_accept:
requires:
- deploy-nightly
release:
jobs:
- gotest:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+-alpha\.[0-9]+$/
- jstest:
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+-alpha\.[0-9]+$/
- release:
requires:
- gotest
- jstest
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+-alpha\.[0-9]+$/