Skip to content

Commit

Permalink
Added script to test the examples and script with example variables
Browse files Browse the repository at this point in the history
  • Loading branch information
tkmcmaster committed Aug 2, 2024
1 parent 376feed commit afd8c89
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/stats-*.json
/search-results*.json
/log-results*
/*.yaml.out
26 changes: 26 additions & 0 deletions examples/test_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e
set +x
source ./variables.sh

if [ -z ${PORT+x} ]; then
echo "PORT is unset. Please start the test-server and specify the PORT variable when running this";
exit 1
else
echo "Testing examples on PORT '$PORT'";
fi
PEWPEW_PATH=("pewpew")
if [[ ! -z "$1" ]] ; then
PEWPEW_PATH=("$1")
fi
PEWPEW_VERSION=$($PEWPEW_PATH --version)
echo "Testing examples against version $PEWPEW_VERSION"


for file in *.yaml; do
[ -f "$file" ] || break
echo "Running: $PEWPEW_PATH run -f json $file"
"$PEWPEW_PATH" run -f json "$file" > "$file.out"
echo "Result: $?"
done
echo "All examples passed!"
5 changes: 5 additions & 0 deletions examples/variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
export PASSWORD=bogus
export RAMP_TIME=5s
export LOAD_TIME=10s
export SCALE_PERCENTAGE=100

0 comments on commit afd8c89

Please sign in to comment.