Skip to content

Commit

Permalink
Fixed runtests.sh script
Browse files Browse the repository at this point in the history
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Mar 30, 2024
1 parent 35d90db commit e1fe57b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
#

set -e
# Change to -x for echoing commands
set +x

catch() {
if [ "$1" != "0" ]; then
"${S1AS_HOME}"/bin/asadmin stop-domain --kill=true --force=true domain1
echo "Error $1 occurred on $2"
"${S1AS_HOME}"/bin/asadmin stop-domain --kill=true --force=true domain1 || true;
echo "Error $1 occurred on $2";
exit $1;
fi
}
Expand All @@ -29,15 +31,17 @@ install_glassfish() {
mvn clean -N org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy \
-Dartifact=org.glassfish.main.distributions:glassfish:${GF_VERSION}:zip \
-Dmdep.stripVersion=true \
-DoutputDirectory=${WORKSPACE}/bundles
-DoutputDirectory=${WORKSPACE}/bundles \
-Pstaging
}

install_jacoco() {
mvn -N org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy \
-Dartifact=org.jacoco:org.jacoco.agent:0.8.8:jar:runtime \
-Dmdep.stripVersion=true \
-Dmdep.stripClassifier=true \
-DoutputDirectory=${WORKSPACE}/bundles
-DoutputDirectory=${WORKSPACE}/bundles \
-Pstaging
}

####################################
Expand Down Expand Up @@ -66,7 +70,7 @@ if [ -z "${test}" ]; then
fi

if [ -z "${JAVA_HOME}" ]; then
export JAVA_HOME=/usr/lib/jvm/jdk11
export JAVA_HOME=/usr/lib/jvm/jdk21
fi
export PATH="${JAVA_HOME}/bin:${PATH}"

Expand All @@ -78,7 +82,7 @@ export M2_HOME="${M2_HOME=$(realpath $(dirname $(realpath $(which mvn)))/..)}"
export APS_HOME="$(pwd)/appserver/tests/appserv-tests"

if [ -z "${2}" ]; then
export GF_VERSION="$(mvn help:evaluate -f "${APS_HOME}/pom.xml" -Dexpression=project.version -q -DforceStdout)"
export GF_VERSION="$(mvn help:evaluate -f "${APS_HOME}/pom.xml" -Dexpression=project.version -q -DforceStdout -Pstaging)"
else
export GF_VERSION="$2"
fi
Expand All @@ -90,7 +94,7 @@ else
fi

export JACOCO_ENABLED="true"
export WORKSPACE="$(pwd)"
export WORKSPACE="$(pwd)/target"
export TEST_RUN_LOG="${WORKSPACE}/tests-run.log"
export GLASSFISH_HOME="${WORKSPACE}/glassfish8"
export CLASSPATH="${GLASSFISH_HOME}/javadb"
Expand Down

0 comments on commit e1fe57b

Please # to comment.