-
Notifications
You must be signed in to change notification settings - Fork 22
/
test.sh
26 lines (26 loc) · 907 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
files=$( ls ./integration/*.jmx)
echo "Files: $files"
for file in $files; do
echo "Cleaning logs"
rm -r reports logs
echo "Running test with $file"
date
filename=$(basename "$file" ".jmx")
echo "Using Extension Manifest: $EXTENSIONS_MANIFEST_PATH"
./apache-jmeter-5.6.3/bin/jmeter -DextensionsManifestPath="$EXTENSIONS_MANIFEST_PATH" -Dnashorn.args=--no-deprecation-warning -n -t $file -l logs/$filename.log -e -o reports ;
error_count=$(cat jmeter.log | grep "summary =" | grep "Err: 1" | wc -l)
echo "Error count: '$error_count'"
echo "##########"
echo "$error_count" == "0"
echo "###########$error_count ###########"
if [ "$error_count" = "0" ]; then
echo "Test $filename OK."
else
echo "Test $filename failed. Error count: '$error_count'."
cat logs/$filename.log
exit 1
fi
done
echo "Done"
date