diff --git a/CHANGELOG.md b/CHANGELOG.md index fa0f035f..2ad52f6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ - Added version info printing using '--version' program argument. - CQL `INSERT JSON` statement support. +### Fixed + +- Panic when `--non-interactive` command line option is passed ([#69](https://github.com/scylladb/gemini/issues/69)) + ## [0.9.0] - 2019-04-03 ### Added diff --git a/cmd/gemini/root.go b/cmd/gemini/root.go index aad22a43..059d68a2 100644 --- a/cmd/gemini/root.go +++ b/cmd/gemini/root.go @@ -192,7 +192,9 @@ func runJob(f testJob, schema *gemini.Schema, s *gemini.Session, mode string) { return case res := <-c: testRes = res.Merge(&testRes) - sp.Suffix = fmt.Sprintf(" Running Gemini... %v", testRes) + if sp != nil { + sp.Suffix = fmt.Sprintf(" Running Gemini... %v", testRes) + } if testRes.ReadErrors > 0 { testRes.PrintResult() if failFast { diff --git a/scripts/gemini-launcher b/scripts/gemini-launcher index 855cafa0..58f36313 100755 --- a/scripts/gemini-launcher +++ b/scripts/gemini-launcher @@ -11,7 +11,7 @@ ORACLE_NAME=gemini-oracle TEST_NAME=gemini-test GEMINI_CMD=/tmp/gemini -docker-compose -f scripts/docker-compose.yml up -d +docker-compose --log-level WARNING -f scripts/docker-compose.yml up -d ORACLE_IP=$(docker inspect --format='{{ .NetworkSettings.Networks.gemini.IPAddress }}' ${ORACLE_NAME}) TEST_IP=$(docker inspect --format='{{ .NetworkSettings.Networks.gemini.IPAddress }}' ${TEST_NAME}) @@ -29,3 +29,4 @@ $GEMINI_CMD \ --test-cluster=${TEST_IP} \ --oracle-cluster=${ORACLE_IP} \ "$@" +exit $? diff --git a/test.sh b/test.sh new file mode 100755 index 00000000..c7a83f37 --- /dev/null +++ b/test.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +launcher_cmd=./scripts/gemini-launcher + +test_gemini() { + echo -n "Running test for 'gemini $@' ... " + $launcher_cmd --duration 1s --drop-schema $@ > /dev/null + if [ $? -eq 0 ] + then + echo "OK" + else + echo "FAILED" + fi + exit $? +} + +test_gemini "--non-interactive"