-
-
Notifications
You must be signed in to change notification settings - Fork 68
523 lines (497 loc) · 18.4 KB
/
test.yaml
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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
lint:
name: "[core] lint"
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Get golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.2
- name: Lint
run: $(go env GOPATH)/bin/golangci-lint run --timeout 10m0s ./...
test-core:
name: "[core] gnomock, gnomockd"
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest]
# runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Install Task
uses: arduino/setup-task@v1
with:
version: '3.0.0'
- uses: docker-practice/actions-setup-docker@master
if: ${{ matrix.os == 'macos-latest' }}
- name: Test Gnomock
run: task test:core:gnomock
- name: Test gnomockd
run: task test:core:gnomockd
- name: Test internal
run: task test:core:internal
- name: Report coverage
run: |
cat gnomock-cover.txt gnomockd-cover.txt internal-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-github-action:
name: "[core] github action"
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Install Task
uses: arduino/setup-task@v1
with:
version: '3.0.0'
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build orlangure/gnomock image
run: task gnomock:build:server
- name: Start Gnomock server
uses: gnomock/github-action@master
- name: Test Gnomock connection
run: curl localhost:23042/stop -d '{"id":"42"}'
test-service-containers:
name: "[core] service container"
runs-on: ubuntu-latest
services:
gnomock:
image: orlangure/gnomock:v0.20.0
options: -v /var/run/docker.sock:/var/run/docker.sock
ports:
- 23042:23042
steps:
- name: Setup postgres
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/runner/.bash_profile
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install httpie
http --ignore-stdin -v :23042/start/postgres options[custom_named_ports][default][protocol]=tcp options[custom_named_ports][default][port]:=5432 options[custom_named_ports][default][host_port]:=15432 options[debug]:=true
- name: Connect 1
run: PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;"
- name: Connect 2
run: PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;"
- name: Connect 3
run: PGPASSWORD=password psql -h 127.0.0.1 -U postgres -p 15432 -c "select 1;"
test-localstack:
name: "[preset] localstack"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/localstack/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestLocalstack
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-elastic:
name: "[preset] elastic"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -covermode=atomic -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/elastic/...
- name: Test server
run: go test -race -cover -covermode=atomic -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestElastic
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-memcached:
name: "[preset] memcached"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/memcached/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestMemcached
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-rabbitmq:
name: "[preset] rabbitmq"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/rabbitmq/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestRabbitMQ
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-kafka:
name: "[preset] kafka"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/kafka/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestKafka
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-postgres:
name: "[preset] postgres"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/postgres/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestPostgres
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-mariadb:
name: "[preset] mariadb"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/mariadb/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestMariaDB
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-splunk:
name: "[preset] splunk"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/splunk/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestSplunk
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-redis:
name: "[preset] redis"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/redis/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestRedis
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-mysql:
name: "[preset] mysql"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/mysql/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestMySQL
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-mssql:
name: "[preset] mssql"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/mssql/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestMSSQL
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-mongo:
name: "[preset] mongo"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/mongo/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestMongo
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-k3s:
name: "[preset] k3s"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/k3s/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestK3s
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-cockroachdb:
name: "[preset] cockroachdb"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/cockroachdb/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestCockroachDB
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-influxdb:
name: "[preset] influxdb"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/influxdb/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestInfluxDB
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-cassandra:
name: "[preset] cassandra"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/cassandra/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestCassandra
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-azurite:
name: "[preset] azurite"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/azurite/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestAzurite
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
test-vault:
name: "[preset] vault"
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v1
with:
go-version: 1.21
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Get dependencies
run: go get -v -t -d ./...
- name: Test preset
run: go test -race -cover -coverprofile=preset-cover.txt -coverpkg=./... -v ./preset/vault/...
- name: Test server
run: go test -race -cover -coverprofile=server-cover.txt -coverpkg=./... -v ./internal/gnomockd -run TestVault
- name: Report coverage
run: |
cat preset-cover.txt server-cover.txt > coverage.txt
bash <(curl -s https://codecov.io/bash)
### preset tests go here