File tree 5 files changed +42
-12
lines changed
5 files changed +42
-12
lines changed Original file line number Diff line number Diff line change 35
35
name : unit test
36
36
env :
37
37
CARGO_INCREMENTAL : 0
38
+ NEXTEST_PROFILE : ci
38
39
runs-on : ubuntu-latest
39
40
steps :
40
41
- uses : actions/checkout@v4
52
53
53
54
integration-test :
54
55
name : integration test
56
+ strategy :
57
+ fail-fast : false
58
+ matrix :
59
+ case : ["integration-test-txn", "integration-test-raw"]
55
60
env :
56
61
CARGO_INCREMENTAL : 0
62
+ NEXTEST_PROFILE : ci
63
+ TIKV_VERSION : v8.5.1
57
64
runs-on : ubuntu-latest
58
65
steps :
59
66
- uses : actions/checkout@v4
@@ -69,14 +76,22 @@ jobs:
69
76
- name : start tiup playground
70
77
run : |
71
78
# use latest stable version
72
- ~/.tiup/bin/tiup install tikv pd
73
- ~/.tiup/bin/tiup playground --mode tikv-slim --kv 3 --without-monitor --kv.config config/tikv.toml --pd.config config/pd.toml &
79
+ ~/.tiup/bin/tiup install tikv:${{ env.TIKV_VERSION }} pd:${{ env.TIKV_VERSION }}
80
+ ~/.tiup/bin/tiup playground ${{ env.TIKV_VERSION }} --mode tikv-slim --kv 3 --tag cluster --without-monitor --kv.config config/tikv.toml --pd.config config/pd.toml &
74
81
while :; do
75
82
echo "waiting cluster to be ready"
76
83
[[ "$(curl -I http://127.0.0.1:2379/pd/api/v1/regions 2>/dev/null | head -n 1 | cut -d$' ' -f2)" -ne "405" ]] || break
77
84
sleep 1
78
85
done
79
86
- name : Install latest nextest release
80
87
uses : taiki-e/install-action@nextest
81
- - name : integration test
82
- run : MULTI_REGION=1 make integration-test
88
+ - name : Integration test
89
+ run : MULTI_REGION=1 make ${{ matrix.case }}
90
+ - name : Upload logs
91
+ if : failure()
92
+ uses : actions/upload-artifact@v4
93
+ with :
94
+ name : cluster-logs
95
+ path : |
96
+ ~/.tiup/data/cluster/tikv*/*.log
97
+ ~/.tiup/data/cluster/pd*/*.log
Original file line number Diff line number Diff line change 1
1
export RUSTFLAGS =-Dwarnings
2
2
3
- .PHONY : default check unit-test integration-tests test doc docker-pd docker-kv docker all
3
+ .PHONY : default check unit-test generate integration-tests integration-tests-txn integration-tests-raw test doc docker-pd docker-kv docker all
4
4
5
5
export PD_ADDRS ?= 127.0.0.1 :2379
6
6
export MULTI_REGION ?= 1
7
7
8
8
ALL_FEATURES := integration-tests
9
9
10
- INTEGRATION_TEST_ARGS := --features "integration-tests"
10
+ NEXTEST_ARGS := --config-file $(shell pwd) /config/nextest.toml
11
+
12
+ INTEGRATION_TEST_ARGS := --features "integration-tests" --test-threads 1
13
+
14
+ RUN_INTEGRATION_TEST := cargo nextest run ${NEXTEST_ARGS} --all ${INTEGRATION_TEST_ARGS}
11
15
12
16
default : check
13
17
@@ -20,12 +24,15 @@ check: generate
20
24
cargo clippy --all-targets --features " ${ALL_FEATURES} " -- -D clippy::all
21
25
22
26
unit-test : generate
23
- cargo nextest run --all --no-default-features
27
+ cargo nextest run ${NEXTEST_ARGS} --all --no-default-features
28
+
29
+ integration-test : integration-test-txn integration-test-raw
30
+
31
+ integration-test-txn : generate
32
+ $(RUN_INTEGRATION_TEST ) txn_
24
33
25
- integration-test : generate
26
- cargo test txn_ --all ${INTEGRATION_TEST_ARGS} -- --nocapture
27
- cargo test raw_ --all ${INTEGRATION_TEST_ARGS} -- --nocapture
28
- cargo test misc_ --all ${INTEGRATION_TEST_ARGS} -- --nocapture
34
+ integration-test-raw : generate
35
+ $(RUN_INTEGRATION_TEST ) raw_
29
36
30
37
test : unit-test integration-test
31
38
Original file line number Diff line number Diff line change
1
+ [profile .ci ]
2
+ retries = 0
3
+ fail-fast = false
4
+ slow-timeout = { period = " 60s" , terminate-after = 10 } # Timeout 10m. TODO: speed up the slow tests.
5
+ failure-output = " final"
6
+
7
+ [profile .ci .junit ]
8
+ path = " junit.xml"
Original file line number Diff line number Diff line change @@ -19,3 +19,4 @@ max-open-files = 10000
19
19
[storage ]
20
20
api-version = 2
21
21
enable-ttl = true
22
+ reserve-space = " 0MiB"
Original file line number Diff line number Diff line change 5
5
//! Test names should begin with one of the following:
6
6
//! 1. txn_
7
7
//! 2. raw_
8
- //! 3. misc_
9
8
//!
10
9
//! We make use of the convention to control the order of tests in CI, to allow
11
10
//! transactional and raw tests to coexist, since transactional requests have
You can’t perform that action at this time.
0 commit comments