Skip to content

Commit

Permalink
Merge pull request #70 from scylladb/fix-non-interactive
Browse files Browse the repository at this point in the history
Fix panic when --non-interactive command line option is passed
  • Loading branch information
Henrik Johansson authored Apr 11, 2019
2 parents 13575ad + e3ba758 commit 050cebe
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion cmd/gemini/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion scripts/gemini-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -29,3 +29,4 @@ $GEMINI_CMD \
--test-cluster=${TEST_IP} \
--oracle-cluster=${ORACLE_IP} \
"$@"
exit $?
17 changes: 17 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 050cebe

Please sign in to comment.