Skip to content

Commit f830c30

Browse files
committed
chore: add resume test
1 parent 26dae3a commit f830c30

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

.github/workflows/ci.yml

+52
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,58 @@ jobs:
995995
path: diagnostics*.gz
996996
retention-days: 1
997997

998+
local_resume_test:
999+
name: Resume local cluster test on (${{ matrix.run }})
1000+
needs: build_primary_binaries
1001+
runs-on: ${{ matrix.os }}
1002+
strategy:
1003+
# fail-fast: false
1004+
matrix:
1005+
os: [ubuntu-latest]
1006+
rust-target: [x86_64-unknown-linux-musl]
1007+
run: [r1]
1008+
steps:
1009+
- uses: actions/checkout@v4
1010+
# Download artifacts
1011+
- name: Download artifact - fluvio
1012+
uses: actions/download-artifact@v4
1013+
with:
1014+
name: fluvio-${{ matrix.rust-target }}
1015+
path: ~/bin
1016+
- name: Download artifact - fluvio-run
1017+
uses: actions/download-artifact@v4
1018+
with:
1019+
name: fluvio-run-${{ matrix.rust-target }}
1020+
path: ~/bin
1021+
- name: Mark executable
1022+
run: |
1023+
chmod +x ~/bin/fluvio-run
1024+
chmod +x ~/bin/fluvio && ~/bin/fluvio version
1025+
echo "${HOME}/bin" >> $GITHUB_PATH
1026+
- name: Install Parallel
1027+
run: sudo apt-get install -y parallel
1028+
1029+
- name: Run resume test with CI artifacts
1030+
timeout-minutes: 10
1031+
env:
1032+
TEST_DATA_BYTES: 10000
1033+
run: |
1034+
date
1035+
make FLUVIO_MODE=local FLUVIO_BIN=~/bin/fluvio resume-test
1036+
1037+
- name: Run diagnostics
1038+
if: ${{ !success() }}
1039+
timeout-minutes: 5
1040+
run: fluvio cluster diagnostics
1041+
- name: Upload logs
1042+
timeout-minutes: 5
1043+
if: ${{ !success() }}
1044+
uses: actions/upload-artifact@v4
1045+
with:
1046+
name: local_upgrade_${{ matrix.run }}_log
1047+
path: diagnostics*.gz
1048+
retention-days: 1
1049+
9981050
# Smoke test across different version of fluvio
9991051
cli_smoke:
10001052
name: CLI smoke test (${{ matrix.test }}) CLI (${{ matrix.cli_version }}) on cluster (${{ matrix.cluster_version }})

makefiles/test.mk

+10
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,16 @@ upgrade-test: build-cli build_k8_image
187187
./tests/upgrade-test.sh
188188
endif
189189

190+
ifeq (${CI},true)
191+
# In CI, we expect all artifacts to already be built and loaded for the script
192+
resume-test:
193+
./tests/local-resume-test.sh
194+
else
195+
# When not in CI (i.e. development), load the dev k8 image before running test
196+
resume-test: build-cli
197+
./tests/local-resume-test.sh
198+
endif
199+
190200
# When running in development, might need to run `cargo clean` to ensure correct fluvio binary is used
191201
validate-release-stable:
192202
./tests/fluvio-validate-release.sh $(VERSION) $(GIT_COMMIT)

tests/local-resume-test.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# #!/bin/bash
2+
${FLUVIO_BIN} cluster delete --force
3+
rm -rf ~/.fluvio
4+
${FLUVIO_BIN} cluster start --local
5+
6+
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} topic create test-topic-{}
7+
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} remote register test-remote-{}
8+
9+
${FLUVIO_BIN} cluster shutdown
10+
${FLUVIO_BIN} cluster resume
11+
12+
# Create topic
13+
${FLUVIO_BIN} topic create test-topic-11 # THIS WAS HANGING
14+
15+
TOPIC_LIST=$(${FLUVIO_BIN} topic list 2>/dev/null)
16+
PARTITION_LIST=$(${FLUVIO_BIN} partition list 2>/dev/null)
17+
REMOTE_LIST=$(${FLUVIO_BIN} remote list 2>/dev/null)
18+
19+
# Check if the topic list has 11+1 lines
20+
if [ $(echo "$TOPIC_LIST" | wc -l) -eq 12 ]; then
21+
echo "PASS"
22+
else
23+
echo "FAIL"
24+
fi
25+
26+
# Check if the partition list has 11+1 lines
27+
if [ $(echo "$PARTITION_LIST" | wc -l) -eq 12 ]; then
28+
echo "PASS"
29+
else
30+
echo "FAIL"
31+
fi
32+
33+
# Check if the remote list has 10+1 lines
34+
if [ $(echo "$REMOTE_LIST" | wc -l) -eq 11 ]; then
35+
echo "PASS"
36+
else
37+
echo "FAIL"
38+
fi

0 commit comments

Comments
 (0)