1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

Fix typos and small IDE hints in IT controller (#588)

This commit is contained in:
Florian Wilhelm
2019-03-26 10:32:26 +01:00
committed by GitHub
parent f138ae1499
commit a6c8a8d94d
2 changed files with 11 additions and 11 deletions

View File

@@ -25,7 +25,7 @@ function notify() {
} }
function cleanup() { function cleanup() {
[ -z "${notificationThreadPid}" ] || kill -PIPE "${notificationThreadPid}" &>/dev/null [[ -z "${notificationThreadPid}" ]] || kill -PIPE "${notificationThreadPid}" &>/dev/null
} }
trap cleanup EXIT trap cleanup EXIT
@@ -33,7 +33,7 @@ trap cleanup EXIT
# #
# In case the build is performed for a pull request TRAVIS_COMMIT is a merge # In case the build is performed for a pull request TRAVIS_COMMIT is a merge
# commit between the base branch and the PR branch HEAD. That commit is actually built. # commit between the base branch and the PR branch HEAD. That commit is actually built.
# But for notifying about a build status we need the commit which is currenty # But for notifying about a build status we need the commit which is currently
# the HEAD of the PR branch. # the HEAD of the PR branch.
# #
# In case the build is performed for a simple branch (not associated with a PR) # In case the build is performed for a simple branch (not associated with a PR)
@@ -42,16 +42,16 @@ trap cleanup EXIT
# TRAVIS_COMMIT itself. # TRAVIS_COMMIT itself.
# #
COMMIT_HASH_FOR_STATUS_NOTIFICATIONS="${TRAVIS_PULL_REQUEST_SHA}" COMMIT_HASH_FOR_STATUS_NOTIFICATIONS="${TRAVIS_PULL_REQUEST_SHA}"
[ -z "${COMMIT_HASH_FOR_STATUS_NOTIFICATIONS}" ] && COMMIT_HASH_FOR_STATUS_NOTIFICATIONS="${TRAVIS_COMMIT}" [[ -z "${COMMIT_HASH_FOR_STATUS_NOTIFICATIONS}" ]] && COMMIT_HASH_FOR_STATUS_NOTIFICATIONS="${TRAVIS_COMMIT}"
notify "pending" "Integration tests in progress." "${COMMIT_HASH_FOR_STATUS_NOTIFICATIONS}" notify "pending" "Integration tests in progress." "${COMMIT_HASH_FOR_STATUS_NOTIFICATIONS}"
WORKSPACES_ROOT=workspaces WORKSPACES_ROOT=workspaces
[ -e "${WORKSPACES_ROOT}" ] && rm -rf ${WORKSPACES_ROOT} [[ -e "${WORKSPACES_ROOT}" ]] && rm -rf ${WORKSPACES_ROOT}
TEST_CASES=$(find testCases -name '*.yml') TEST_CASES=$(find testCases -name '*.yml')
# This auxiliar thread is needed in order to produce some output while the # This auxiliary thread is needed in order to produce some output while the
# test are running. Otherwise the job will be canceled after 10 minutes without # test are running. Otherwise the job will be canceled after 10 minutes without
# output. # output.
while true; do sleep 10; echo "[INFO] Integration tests still running."; done & while true; do sleep 10; echo "[INFO] Integration tests still running."; done &
@@ -65,7 +65,7 @@ do
area=$(dirname "${f#*/}") area=$(dirname "${f#*/}")
echo "[INFO] Running test case \"${testCase}\" in area \"${area}\"." echo "[INFO] Running test case \"${testCase}\" in area \"${area}\"."
TEST_CASE_ROOT="${WORKSPACES_ROOT}/${area}/${testCase}" TEST_CASE_ROOT="${WORKSPACES_ROOT}/${area}/${testCase}"
[ -e "${TEST_CASE_ROOT}" ] && rm -rf "${TEST_CASE_ROOT}" [[ -e "${TEST_CASE_ROOT}" ]] && rm -rf "${TEST_CASE_ROOT}"
mkdir -p "${TEST_CASE_ROOT}" || fail "Cannot create test case root directory for test case \"${testCase}\"." 1 mkdir -p "${TEST_CASE_ROOT}" || fail "Cannot create test case root directory for test case \"${testCase}\"." 1
source ./runTest.sh "${testCase}" "${TEST_CASE_ROOT}" &> "${TEST_CASE_ROOT}/log.txt" & source ./runTest.sh "${testCase}" "${TEST_CASE_ROOT}" &> "${TEST_CASE_ROOT}/log.txt" &
pid=$! pid=$!
@@ -74,7 +74,7 @@ do
let i=i+1 let i=i+1
done done
[ "${i}" == 0 ] && fail "No tests has been executed." 1 [[ "${i}" == 0 ]] && fail "No tests has been executed." 1
# #
# wait for the test cases and cat the log # wait for the test cases and cat the log
@@ -112,7 +112,7 @@ do
area=$(dirname "${p%:*}") area=$(dirname "${p%:*}")
testCase=$(basename "${p%:*}") testCase=$(basename "${p%:*}")
TEST_CASE_ROOT="${WORKSPACES_ROOT}/${area}/${testCase}" TEST_CASE_ROOT="${WORKSPACES_ROOT}/${area}/${testCase}"
if [ -f "${TEST_CASE_ROOT}/SUCCESS" ] if [[ -f "${TEST_CASE_ROOT}/SUCCESS" ]]
then then
status="SUCCESS" status="SUCCESS"
else else
@@ -125,7 +125,7 @@ done
STATUS_DESCRIPTION="The integration tests failed." STATUS_DESCRIPTION="The integration tests failed."
STATUS_STATE="failure" STATUS_STATE="failure"
if [ "${failure}" == "false" ] if [[ "${failure}" == "false" ]]
then then
STATUS_DESCRIPTION="The integration tests succeeded." STATUS_DESCRIPTION="The integration tests succeeded."
STATUS_STATE="success" STATUS_STATE="success"
@@ -133,7 +133,7 @@ fi
notify "${STATUS_STATE}" "${STATUS_DESCRIPTION}" "${COMMIT_HASH_FOR_STATUS_NOTIFICATIONS}" notify "${STATUS_STATE}" "${STATUS_DESCRIPTION}" "${COMMIT_HASH_FOR_STATUS_NOTIFICATIONS}"
[ "${failure}" != "false" ] && fail "Integration tests failed." 1 [[ "${failure}" != "false" ]] && fail "Integration tests failed." 1
echo "[INFO] Integration tests succeeded." echo "[INFO] Integration tests succeeded."
exit 0 exit 0

View File

@@ -27,4 +27,4 @@ RC=$?
cd - &> /dev/null || { echo "[ERROR] change directory back into integration test root folder failed."; exit 1; } cd - &> /dev/null || { echo "[ERROR] change directory back into integration test root folder failed."; exit 1; }
[ "${RC}" == 0 ] && touch "${TEST_CASE_ROOT}/SUCCESS" [[ "${RC}" == 0 ]] && touch "${TEST_CASE_ROOT}/SUCCESS"