-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathentrypoint.sh
executable file
·54 lines (43 loc) · 1.37 KB
/
entrypoint.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
TESTFILE_PATH=$3
echo "Using Test File Path $TESTFILE_PATH"
# Removing first 3 arguments from Entrypoint. Need to find a better way to do this
set -- "${@:1:0}" "${@:2}"
set -- "${@:1:0}" "${@:2}"
set -- "${@:1:0}" "${@:2}"
echo $@
# Export JAVA_HOME Variable within Entrypoint
export JAVA_HOME="/usr/lib/jvm/java-9-openjdk"
if [ -n "$DEPENDENCY_FOLDER" ]
then
cp ${GITHUB_WORKSPACE}/${DEPENDENCY_FOLDER}/*.jar ${JMETER_HOME}/lib/
fi
if [ -n "$PLUGINS" ]
then
echo "$PLUGINS" | tr "," "\n" | parallel -I% --jobs 5 "${JMETER_HOME}/bin/PluginsManagerCMD.sh install %"
fi
status=0
if [[ $TESTFILE_PATH == *.jmx ]]
then
echo "Single file specified so only running one test"
echo "Running jmeter -n -t $TESTFILE_PATH $@"
jmeter -n -t $TESTFILE_PATH $@
status=$?
else
BASEFILE_PATH=$(basename $TESTFILE_PATH)
echo "Folder specified - Running each JMX File In Folder"
for FILE in $(find $BASEFILE_PATH -name '*.jmx')
do
echo "Running test with $FILE"
jmeter -n -t $FILE $@
test_run=$?
# If any of the previous tests haven't failed
if [ "$test_run" == "0" ] && [ "$status" == "1" ]
then
status=1 # Set one of the tests failing
fi
echo "Test $FILE has exited with status code $test_run"
done
fi
error=0 # Default error status code
[ $status -eq 0 ] && exit 0 || echo "JMeter exited with status code $status" && exit $status