Skip to content

Commit ef4dd46

Browse files
committed
chore: run the local-resume-test 5 times
1 parent f830c30 commit ef4dd46

File tree

2 files changed

+56
-38
lines changed

2 files changed

+56
-38
lines changed

makefiles/test.mk

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ ifeq (${CI},true)
181181
# In CI, we expect all artifacts to already be built and loaded for the script
182182
upgrade-test:
183183
./tests/upgrade-test.sh
184+
else ifeq (${FLUVIO_MODE},local)
185+
upgrade-test: build-cli
186+
./tests/upgrade-test.sh
184187
else
185188
# When not in CI (i.e. development), load the dev k8 image before running test
186189
upgrade-test: build-cli build_k8_image

tests/local-resume-test.sh

+53-38
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,53 @@
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
1+
#!/bin/bash
2+
3+
function run_test() {
4+
${FLUVIO_BIN} cluster delete --force
5+
# rm -rf ~/.fluvio
6+
${FLUVIO_BIN} cluster start --local
7+
8+
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} topic create test-topic-{}
9+
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} remote register test-remote-{}
10+
11+
${FLUVIO_BIN} cluster shutdown
12+
${FLUVIO_BIN} cluster resume
13+
14+
# Create topic
15+
${FLUVIO_BIN} topic create test-topic-11 # THIS WAS HANGING
16+
17+
TOPIC_LIST=$(${FLUVIO_BIN} topic list 2>/dev/null)
18+
PARTITION_LIST=$(${FLUVIO_BIN} partition list 2>/dev/null)
19+
REMOTE_LIST=$(${FLUVIO_BIN} remote list 2>/dev/null)
20+
21+
# Check if the topic list has 11+1 lines
22+
if [ $(echo "$TOPIC_LIST" | wc -l) -eq 12 ]; then
23+
echo "PASS"
24+
else
25+
echo "FAIL"
26+
exit 1
27+
fi
28+
29+
# Check if the partition list has 11+1 lines
30+
if [ $(echo "$PARTITION_LIST" | wc -l) -eq 12 ]; then
31+
echo "PASS"
32+
else
33+
echo "FAIL"
34+
exit 1
35+
fi
36+
37+
# Check if the remote list has 10+1 lines
38+
if [ $(echo "$REMOTE_LIST" | wc -l) -eq 11 ]; then
39+
echo "PASS"
40+
else
41+
echo "FAIL"
42+
exit 1
43+
fi
44+
}
45+
46+
function main() {
47+
for i in {1..5}
48+
do
49+
run_test
50+
done
51+
}
52+
53+
main;

0 commit comments

Comments
 (0)