-
Notifications
You must be signed in to change notification settings - Fork 0
/
gomake.yml
107 lines (92 loc) · 3.34 KB
/
gomake.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
testSetup:
doc: Run autogql generation for ./testservice
script:
- cd testservice
- go run plugin/main.go
- cd ..
gen_testQueries:
doc: for creating new integrationtest to generate client files for ./integration/genqclient.graphql
script:
- go get github.com/Khan/genqlient/generate@v0.6.0
- cd integration
- go run github.com/Khan/genqlient
testSqlite:
doc: for multi stage test==> gomake srun test
stage: test
color: {{.Colors.teal}}
script:
- rm integration/test.db
- PORT=8434 DATABASE_TYPE=sqlite DATABASE_CONNECTION_STRING=test.db go test ./integration . -v
mysqlstarting:
doc: for multi stage test==> gomake srun test
stage: test
color: {{.Colors.magenta}}
script:
- docker run --health-cmd='mysqladmin ping --silent' --rm --name autogql-test-mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=autogql -p 3306:3306 mysql
postgresstarting:
doc: for multi stage test==> gomake srun test
stage: test
color: {{.Colors.green}}
script:
- docker run --health-cmd='pg_isready -U postgres -d autogql' --rm --name autogql-test-postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=autogql -p 5432:5432 postgres
waitForPostgres:
doc: interal...
script:
- echo wait until postgres is startet
- while [ $(docker inspect --format "{{"{{json .State.Health.Status }}"}}" autogql-test-postgres) != "\"healthy\"" ]; do printf ".\n"; sleep 1; done
testPostgres:
doc: for multi stage test==> gomake srun test
stage: test
color: {{.Colors.red}}
script:
{{include "waitForPostgres"}}
- PORT=8431 DATABASE_TYPE=postgres DATABASE_CONNECTION_STRING='host=localhost user=postgres password=postgres dbname=autogql port=5432 sslmode=disable' go test ./integration . -v
- docker kill autogql-test-postgres
on_failure:
- docker kill autogql-test-postgres
waitForMySqlDb:
doc: internal...
script:
- echo wait until mysql is startet
- while [ $(docker inspect --format "{{"{{json .State.Health.Status }}"}}" autogql-test-mysql) != "\"healthy\"" ]; do printf ".\n"; sleep 1; done
testMySql:
doc: for multi stage test==> gomake srun test
stage: test
color: {{.Colors.purple}}
script:
{{include "waitForMySqlDb"}}
- PORT=8432 DATABASE_TYPE=mysql DATABASE_CONNECTION_STRING='root:password@tcp(127.0.0.1:3306)/autogql' go test ./integration . -v
- docker kill autogql-test-mysql
on_failure:
- docker kill autogql-test-mysql
testCiSqlLite:
doc: for ci ==> sqlite Test
script:
{{include "testSqlite"}}
testCiMySql:
doc: for ci ==> mysql Test
script:
- DATABASE_TYPE=mysql DATABASE_CONNECTION_STRING='root:password@tcp(127.0.0.1:3306)/autogql?parseTime=true' go test ./integration . -v
testCiPostgres:
doc: for ci ==> postgres Test
script:
- DATABASE_TYPE=postgres DATABASE_CONNECTION_STRING='host=localhost user=postgres password=postgres dbname=autogql port=5432 sslmode=disable' go test ./integration . -v
test:
doc: gen code and test all databases in parallel
script:
{{include "testSetup"}}
- gomake srun test
test:local:
doc: test locally sqllite
script:
{{include "testSetup"}}
{{include "testSqlite"}}
next:tag:dry:
doc: show next tag with svu
script:
- svu next
next:tag:push:
doc: Create next tag with svu
script:
- git tag "$(svu next)"
- git push --tags