Skip to content

Commit df3050e

Browse files
committed
Add a script to run Jepsen tests
One can use tests as a JAR file as below: $ java -jar target/jepsen.tarantool-0.1.0-standalone.jar Usage: lein run -- COMMAND [OPTIONS ...] Commands: analyze, serve, test, test-all However it is not convenient to write `java -jar ...` each time, so shell script `run-jepsen` was added that do it for you. $ ./run-jepsen Usage: run-jepsen test --help $ ./run-jepsen test --username root --nodes-file nodes --workload register Related to #97
1 parent bbe6e63 commit df3050e

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
lein uberjar
3434
zip jepsen.tarantool-${{ env.TAG }}.zip
3535
target/jepsen.tarantool-${{ env.TAG }}-standalone.jar
36+
run-jepsen
3637
README.md
3738
CHANGELOG.md
3839

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ change log follows the conventions of
6161
- Add primary node discovery (#43, #17).
6262
- Add bank workload (#67).
6363
- Enable uberjar support and build JAR file in CI.
64+
- Add shell script for running Jepsen tests.

run-jepsen

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
release_version="0.1.0"
6+
7+
test_options=$@
8+
if test -z "$test_options"; then
9+
echo "Usage: $(basename "$0") test --help"
10+
exit 0
11+
fi
12+
13+
jar_path="./target/jepsen.tarantool-${release_version}-standalone.jar"
14+
if [ ! -f "$jar_path" ]; then
15+
echo "JAR file ($jar_path) is not found!"
16+
exit 1
17+
fi
18+
19+
java_path=$(readlink -f $(which java))
20+
if test -z "$java_path"; then
21+
echo "No Java binary found."
22+
exit 1
23+
fi
24+
25+
cmd_line="$java_path -jar $jar_path $test_options"
26+
eval $cmd_line

0 commit comments

Comments
 (0)