Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions test/bin/ci_phase_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
#
# This script runs on the CI cluster, from the metal-tests step.

set -xeuo pipefail

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${SCRIPTDIR}/common.sh"

cd "${TESTDIR}"

if [ ! -d "${RF_VENV}" ]; then
"${ROOTDIR}/scripts/fetch_tools.sh" robotframework
fi

for scenario in ./scenarios/*.sh; do
scenario_name="$(basename "${scenario}" .sh)"
logfile="${SCENARIO_INFO_DIR}/${scenario_name}/run.log"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to override the SCENARIO_INFO_DIR to point to the location in the artifact dir where the scenario data has been downloaded in the previous step. We might need a new variable in common.sh to make overriding all of the other directory variables easier.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, was just creating this commit to check whats needed from openshift/release and work it out from that starting point.
Base path for everything will also change once the microshift-test-payload image disappears, so we need to make it configurable in an easy way. Thanks for the heads up!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the artifact dir shared between pods in the CI cluster? Or should we use the shared directory and then copy the content into the artifact directory separately?

mkdir -p "$(dirname "${logfile}")"
bash -x ./bin/scenario.sh run "${scenario}" >"${logfile}" 2>&1 &
done

FAIL=0
for job in $(jobs -p) ; do
jobs -l
echo "Waiting for job: ${job}"
wait "${job}" || ((FAIL+=1))
done

echo "Test phase complete"
if [[ ${FAIL} -ne 0 ]]; then
exit 1
fi
2 changes: 1 addition & 1 deletion test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ API_PORT: ${api_port}
LB_PORT: ${lb_port}
USHIFT_HOST: ${public_ip}
USHIFT_USER: redhat
SSH_PRIV_KEY: "${SSH_PRIVATE_KEY:-}"
SSH_PRIV_KEY: ${SSH_PRIVATE_KEY:-${HOME}/.ssh/id_rsa}
SSH_PORT: ${ssh_port}
EOF

Expand Down