Skip to content

Commit a46c080

Browse files
authored
Merge pull request #208 from ydb-platform/wait-ydb-container
wait ydb container ready before table tests
2 parents 62a549f + 879142d commit a46c080

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
while ! docker run --network host cr.yandex/yc/yandex-docker-local-ydb:latest /ydb -e grpc://localhost:2136 -d /local scheme ls; do
4+
echo wait db...
5+
sleep 3
6+
done
7+
echo DB available

.github/workflows/tests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
image: cr.yandex/yc/yandex-docker-local-ydb:latest
4141
ports:
4242
- 2135:2135
43+
- 2136:2136
4344
- 8765:8765
4445
volumes:
4546
- /tmp/ydb_certs:/ydb_certs
@@ -63,6 +64,8 @@ jobs:
6364
go-version: ${{ matrix.go-version }}
6465
- name: Checkout code
6566
uses: actions/checkout@v2
67+
- name: Wait database available
68+
run: bash ./.github/scripts/wait-ydb-container.sh
6669
- name: Test
6770
run: go test -race -coverpkg=./... -coverprofile table.txt -covermode atomic ./test/table_test.go
6871
- name: Upload coverage to Codecov
@@ -81,6 +84,7 @@ jobs:
8184
image: cr.yandex/yc/yandex-docker-local-ydb:latest
8285
ports:
8386
- 2135:2135
87+
- 2136:2136
8488
- 8765:8765
8589
volumes:
8690
- /tmp/ydb_certs:/ydb_certs
@@ -102,6 +106,8 @@ jobs:
102106
go-version: ${{ matrix.go-version }}
103107
- name: Checkout code
104108
uses: actions/checkout@v2
109+
- name: Wait database available
110+
run: bash ./.github/scripts/wait-ydb-container.sh
105111
- name: Test
106112
run: go test -race -coverpkg=./... -coverprofile ratelimiter.txt -covermode atomic ./test/ratelimiter_test.go
107113
shell: bash
@@ -121,6 +127,7 @@ jobs:
121127
image: cr.yandex/yc/yandex-docker-local-ydb:latest
122128
ports:
123129
- 2135:2135
130+
- 2136:2136
124131
- 8765:8765
125132
volumes:
126133
- /tmp/ydb_certs:/ydb_certs
@@ -142,6 +149,8 @@ jobs:
142149
go-version: ${{ matrix.go-version }}
143150
- name: Checkout code
144151
uses: actions/checkout@v2
152+
- name: Wait database available
153+
run: bash ./.github/scripts/wait-ydb-container.sh
145154
- name: Test
146155
run: go test -race -coverpkg=./... -coverprofile scripting.txt -covermode atomic ./test/scripting_test.go
147156
- name: Upload coverage to Codecov
@@ -160,6 +169,7 @@ jobs:
160169
image: cr.yandex/yc/yandex-docker-local-ydb:latest
161170
ports:
162171
- 2135:2135
172+
- 2136:2136
163173
- 8765:8765
164174
volumes:
165175
- /tmp/ydb_certs:/ydb_certs
@@ -181,6 +191,8 @@ jobs:
181191
go-version: ${{ matrix.go-version }}
182192
- name: Checkout code
183193
uses: actions/checkout@v2
194+
- name: Wait database available
195+
run: bash ./.github/scripts/wait-ydb-container.sh
184196
- name: Test
185197
run: go test -race -coverpkg=./... -coverprofile discovery.txt -covermode atomic ./test/discovery_test.go
186198
- name: Upload coverage to Codecov
@@ -199,6 +211,7 @@ jobs:
199211
image: cr.yandex/yc/yandex-docker-local-ydb:latest
200212
ports:
201213
- 2135:2135
214+
- 2136:2136
202215
- 8765:8765
203216
volumes:
204217
- /tmp/ydb_certs:/ydb_certs
@@ -220,6 +233,8 @@ jobs:
220233
go-version: ${{ matrix.go-version }}
221234
- name: Checkout code
222235
uses: actions/checkout@v2
236+
- name: Wait database available
237+
run: bash ./.github/scripts/wait-ydb-container.sh
223238
- name: Test
224239
run: go test -race -coverpkg=./... -coverprofile connection.txt -covermode atomic ./test/connection_test.go
225240
- name: Upload coverage to Codecov

0 commit comments

Comments
 (0)