Skip to content

Commit 894d440

Browse files
author
wuxianrong
committed
add consostency go test
1 parent 1e131ea commit 894d440

5 files changed

Lines changed: 864 additions & 7 deletions

File tree

.github/workflows/pika.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,26 @@ jobs:
121121
- name: Run Go E2E Tests
122122
working-directory: ${{ github.workspace }}/build
123123
run: |
124-
cd ../tools/pika_keys_analysis/
125-
go test -v ./...
126-
cd ../../tests/integration/
127124
chmod +x integrate_test.sh
128125
sh integrate_test.sh
129126
127+
# Raft Consistency Tests (optional - requires raft-enabled build)
128+
- name: Start Raft Cluster
129+
working-directory: ${{ github.workspace }}/build
130+
continue-on-error: true
131+
run: |
132+
chmod +x ../tests/integration/start_raft_cluster.sh
133+
../tests/integration/start_raft_cluster.sh || echo "Raft cluster start skipped or failed (may not be supported in this build)"
134+
135+
- name: Run Raft Consistency Tests
136+
working-directory: ${{ github.workspace }}/build
137+
continue-on-error: true
138+
run: |
139+
cd ../tests/integration/raft/
140+
go mod init raft-test 2>/dev/null || true
141+
go mod tidy
142+
go test -v -timeout 30m || echo "Raft consistency tests skipped or failed"
143+
130144
build_on_rocky:
131145
runs-on: ubuntu-latest
132146
container:
@@ -338,12 +352,26 @@ jobs:
338352
run: |
339353
find . -name "pika.conf" -exec sed -i 's/loglevel : info/loglevel : error/g' {} +
340354
find . -name "pika.conf" -exec sed -i 's/loglevel : debug/loglevel : error/g' {} +
341-
cd ../tools/pika_keys_analysis/
342-
go test -v ./...
343-
cd ../../tests/integration/
344355
chmod +x integrate_test.sh
345356
sh integrate_test.sh
346357
358+
# Raft Consistency Tests (optional - requires raft-enabled build)
359+
- name: Start Raft Cluster
360+
working-directory: ${{ github.workspace }}/build
361+
continue-on-error: true
362+
run: |
363+
chmod +x ../tests/integration/start_raft_cluster.sh
364+
../tests/integration/start_raft_cluster.sh || echo "Raft cluster start skipped or failed (may not be supported in this build)"
365+
366+
- name: Run Raft Consistency Tests
367+
working-directory: ${{ github.workspace }}/build
368+
continue-on-error: true
369+
run: |
370+
cd ../tests/integration/raft/
371+
go mod init raft-test 2>/dev/null || true
372+
go mod tidy
373+
go test -v -timeout 30m || echo "Raft consistency tests skipped or failed"
374+
347375
build_on_macos:
348376

349377
runs-on: macos-14
@@ -403,7 +431,25 @@ jobs:
403431
run: |
404432
cd tests/integration/
405433
chmod +x integrate_test.sh
406-
# sh integrate_test.sh
434+
sh integrate_test.sh
435+
436+
# Raft Consistency Tests (optional - requires raft-enabled build)
437+
- name: Start Raft Cluster
438+
working-directory: ${{ github.workspace }}
439+
continue-on-error: true
440+
run: |
441+
cd tests/integration/
442+
chmod +x start_raft_cluster.sh
443+
./start_raft_cluster.sh || echo "Raft cluster start skipped or failed (may not be supported in this build)"
444+
445+
- name: Run Raft Consistency Tests
446+
working-directory: ${{ github.workspace }}
447+
continue-on-error: true
448+
run: |
449+
cd tests/integration/raft/
450+
go mod init raft-test 2>/dev/null || true
451+
go mod tidy
452+
go test -v -timeout 30m || echo "Raft consistency tests skipped or failed"
407453
408454
build_pika_image:
409455
name: Build Pika Docker image

tests/integration/main_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ func TestPikaWithoutCache(t *testing.T) {
3030
RegisterFailHandler(Fail)
3131
RunSpecs(t, "Pika integration test without cache")
3232
}
33+
34+
// Note: TestRaftConsistency is now in a separate package (tests/integration/raft)
35+
// Run Raft consistency tests with:
36+
// cd tests/integration/raft && go test -v -timeout 30m

0 commit comments

Comments
 (0)