Skip to content

Commit 42ae0c6

Browse files
wunkiBart Koelman
authored and
Bart Koelman
committed
fix: add shebang and check for results directory
1 parent 41592d8 commit 42ae0c6

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

Diff for: load-test/test.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ while [ "$(curl --write-out %{http_code} --silent --output /dev/null http://app/
1111
sleep 1
1212
done
1313

14+
results_dir="./results"
15+
if [ ! -e "$results_dir" ]; then
16+
mkdir -p "$results_dir"
17+
fi
18+
1419
attack_get() {
1520
file_name="$i-GET_$1_$3_$4.txt"
16-
file_path="./results/$file_name"
21+
file_path="./$results_dir/$file_name"
1722
url="http://app$2"
1823

1924
echo "Running $file_name"
@@ -27,7 +32,7 @@ attack_get() {
2732

2833
attack_post() {
2934
file_name="$i-POST_$1_$4_$5.txt"
30-
file_path="./results/$file_name"
35+
file_path="./$results_dir/$file_name"
3136
url="http://app$2"
3237

3338
echo "Running $file_name"
@@ -93,7 +98,7 @@ post_tag 50 10
9398

9499
if [ "$UPLOAD_RESULTS" = "true" ]; then
95100
echo "Test complete. Uploading results."
96-
./upload_results
101+
upload_results
97102
else
98103
echo "Test complete. Skipping results upload."
99104
fi

Diff for: remove-droplet.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env sh
2+
13
docker-machine stop docker-sandbox
24
docker-machine rm docker-sandbox -y
35

Diff for: run-local.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env sh
12
export UPLOAD_RESULTS="false"
23

34
docker-compose -f stack.yml build

Diff for: run-on-droplet.sh

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env sh
2+
13
case ${DIGITAL_OCEAN_TOKEN-} in '') echo "$0: Environment variable DIGITAL_OCEAN_TOKEN is not set" >&2; exit 1;; esac
24

35
export UPLOAD_RESULTS="true"

0 commit comments

Comments
 (0)