Skip to content

Commit bfca1af

Browse files
committed
chore: intergration test CI
1 parent d4c76f1 commit bfca1af

File tree

3 files changed

+28
-22
lines changed

3 files changed

+28
-22
lines changed

.github/workflows/integration-tests.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@ env:
1717
jobs:
1818
integration-tests:
1919
runs-on: ubuntu-latest
20-
21-
services:
22-
greptimedb:
23-
image: greptime/greptimedb:latest
24-
ports:
25-
- 4001:4001 # gRPC
26-
- 4000:4000 # HTTP
27-
options: >-
28-
--health-cmd "curl -f http://localhost:4000/health"
29-
--health-interval 10s
30-
--health-timeout 5s
31-
--health-retries 10
32-
--health-start-period 30s
33-
env:
34-
GREPTIMEDB_LOG_LEVEL: info
3520

3621
steps:
3722
- name: Checkout repository
@@ -47,10 +32,11 @@ jobs:
4732
with:
4833
key: integration-tests
4934

50-
- name: Wait for GreptimeDB to be ready
35+
- name: Install Protocol Buffers compiler
5136
run: |
52-
timeout 60 bash -c 'until curl -f http://localhost:4000/health; do sleep 1; done'
53-
echo "GreptimeDB is ready!"
37+
sudo apt-get update
38+
sudo apt-get install -y protobuf-compiler
39+
protoc --version
5440
5541
- name: Run format check
5642
run: cargo fmt --all -- --check
@@ -64,11 +50,17 @@ jobs:
6450
- name: Run unit tests
6551
run: cargo test --lib
6652

53+
- name: Start GreptimeDB with Docker Compose
54+
run: |
55+
docker compose -f docker-compose.test.yml up -d
56+
timeout 60 bash -c 'until curl -f http://localhost:4000/health; do sleep 1; done'
57+
echo "GreptimeDB is ready!"
58+
6759
- name: Run integration tests
6860
run: cargo test --test integration --features integration-tests --verbose
6961
env:
7062
RUST_LOG: info
7163

72-
- name: Run integration tests with custom script
73-
run: ./scripts/run_integration_tests.sh
74-
if: success()
64+
- name: Cleanup
65+
run: docker compose -f docker-compose.test.yml down -v
66+
if: always()

scripts/run_integration_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ case "$1" in
129129
*)
130130
main "$@"
131131
;;
132-
esac
132+
esac

tests/integration/integration_test.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright 2023 Greptime Team
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
// Integration tests for GreptimeDB Rust Ingester
216
// These tests require a running GreptimeDB instance
317

0 commit comments

Comments
 (0)