File tree Expand file tree Collapse file tree 5 files changed +42
-12
lines changed Expand file tree Collapse file tree 5 files changed +42
-12
lines changed Original file line number Diff line number Diff line change 3535 name : unit test
3636 env :
3737 CARGO_INCREMENTAL : 0
38+ NEXTEST_PROFILE : ci
3839 runs-on : ubuntu-latest
3940 steps :
4041 - uses : actions/checkout@v4
5253
5354 integration-test :
5455 name : integration test
56+ strategy :
57+ fail-fast : false
58+ matrix :
59+ case : ["integration-test-txn", "integration-test-raw"]
5560 env :
5661 CARGO_INCREMENTAL : 0
62+ NEXTEST_PROFILE : ci
63+ TIKV_VERSION : v8.5.1
5764 runs-on : ubuntu-latest
5865 steps :
5966 - uses : actions/checkout@v4
@@ -69,14 +76,22 @@ jobs:
6976 - name : start tiup playground
7077 run : |
7178 # 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 &
7481 while :; do
7582 echo "waiting cluster to be ready"
7683 [[ "$(curl -I http://127.0.0.1:2379/pd/api/v1/regions 2>/dev/null | head -n 1 | cut -d$' ' -f2)" -ne "405" ]] || break
7784 sleep 1
7885 done
7986 - name : Install latest nextest release
8087 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 11export RUSTFLAGS =-Dwarnings
22
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
44
55export PD_ADDRS ?= 127.0.0.1 :2379
66export MULTI_REGION ?= 1
77
88ALL_FEATURES := integration-tests
99
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}
1115
1216default : check
1317
@@ -20,12 +24,15 @@ check: generate
2024 cargo clippy --all-targets --features " ${ALL_FEATURES} " -- -D clippy::all
2125
2226unit-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_
2433
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_
2936
3037test : unit-test integration-test
3138
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
1919[storage ]
2020api-version = 2
2121enable-ttl = true
22+ reserve-space = " 0MiB"
Original file line number Diff line number Diff line change 55//! Test names should begin with one of the following:
66//! 1. txn_
77//! 2. raw_
8- //! 3. misc_
98//!
109//! We make use of the convention to control the order of tests in CI, to allow
1110//! transactional and raw tests to coexist, since transactional requests have
You can’t perform that action at this time.
0 commit comments