Skip to content

Commit

Permalink
Added JGrab Client Shell Test.
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoathaydes committed Apr 29, 2024
1 parent 9866624 commit 584f197
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,4 @@ jobs:
run: cargo build
- name: Smoke Test
shell: bash
run: |
export JGRAB_HOME="$(pwd)/.jgrab"
mkdir $JGRAB_HOME
cp ./jgrab-runner/build/libs/jgrab.jar $JGRAB_HOME/jgrab.jar
ls -al $JGRAB_HOME
./jgrab-client/target/debug/jgrab-client -e "2 + 2"
run: jgrab-client/test.sh
29 changes: 29 additions & 0 deletions jgrab-client/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -e

DIR=$(dirname "$0")
export JGRAB_HOME="$DIR/.jgrab"
mkdir "$JGRAB_HOME"
cp "$DIR"/../jgrab-runner/build/libs/jgrab.jar "$JGRAB_HOME"/jgrab.jar
ls -al "$JGRAB_HOME"
jgrab="$DIR"/target/debug/jgrab-client

# start the daemon
$jgrab -t

result=$($jgrab -e "2 + 2")

if test "$result" = "4"
then
echo "OK"
else
echo "Failed, result is not 4: $result"
exit 1
fi

# cleanup
$jgrab -s

# on Windows, this may fail
rm -r "$JGRAB_HOME" || true

0 comments on commit 584f197

Please sign in to comment.