Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tests:
{"name": "odf-operator", "install_namespace": "openshift-storage", "channel": "stable-4.21", "target_namespaces": "!install", "operator_group": "openshift-storage-operator-group"}
]
REPORT_TO_DR: "true"
REPORTPORTAL_CMP: ODF-lp-interop
REPORTPORTAL_CMP: lp-ocp-compat--ODF
USER_TAGS: |
scenario odf
ZONES_COUNT: "3"
Expand Down Expand Up @@ -93,7 +93,7 @@ tests:
{"name": "odf-operator", "install_namespace": "openshift-storage", "channel": "stable-4.21","target_namespaces": "!install", "operator_group": "openshift-storage-operator-group"}
]
REPORT_TO_DR: "true"
REPORTPORTAL_CMP: ODF-lp-interop
REPORTPORTAL_CMP: lp-ocp-compat--ODF
USER_TAGS: |
scenario odf
ZONES_COUNT: "3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,19 @@ cleanup() {
echo "Cleaning up..."
[[ -d "${CLUSTER_PATH}/auth" ]] && rm -fvr "${CLUSTER_PATH}/auth"
}
# Set trap to catch EXIT and run cleanup on any exit code
trap cleanup EXIT SIGINT

function install_yq_if_not_exists() {
# Install yq manually if not found in image
echo "Checking if yq exists"
cmd_yq="$(yq --version 2>/dev/null || true)"
if [ -n "$cmd_yq" ]; then
echo "yq version: $cmd_yq"
else
echo "Installing yq"
mkdir -p /tmp/bin
export PATH=$PATH:/tmp/bin/
curl -L "https://github.com/mikefarah/yq/releases/latest/download/yq_linux_$(uname -m | sed 's/aarch64/arm64/;s/x86_64/amd64/')" \
-o /tmp/bin/yq && chmod +x /tmp/bin/yq
fi
}

function mapTestsForComponentReadiness() {
if [[ $MAP_TESTS == "true" ]]; then
results_file="${1}"
echo "Patching Tests Result File: ${results_file}"
if [ -f "${results_file}" ]; then
install_yq_if_not_exists
export REPORTPORTAL_CMP
echo "Mapping Test Suite Name To: ${REPORTPORTAL_CMP}"
yq eval -px -ox -iI0 '.testsuites.testsuite.+@name=env(REPORTPORTAL_CMP)' $results_file || echo "Warning: yq failed for ${results_file}, debug manually" >&2
fi
fi
}
if [ "${MAP_TESTS}" = "true" ]; then
eval "$(
curl -fsSL \
https://raw.githubusercontent.com/RedHatQE/OpenShift-LP-QE--Tools/refs/heads/main/libs/bash/ci-operator/interop/common/ExitTrap--PostProcessPrep.sh
)"; trap '
cleanup
LP_IO__ET_PPP__NEW_TS_NAME="${REPORTPORTAL_CMP}--%s" \
ExitTrap--PostProcessPrep junit--odf__interop-tests__ocs-tests__interop-tests-ocs-tests.xml
' EXIT
else
trap 'cleanup' EXIT
fi

#
# Remove the ACM Subscription to allow OCS interop tests full control of operators
Expand Down Expand Up @@ -140,12 +123,6 @@ FINISH_TIME=$(date "+%s")
DIFF_TIME=$((FINISH_TIME-START_TIME))
set +x

# Map tests if needed for related use cases
mapTestsForComponentReadiness "${CLUSTER_PATH}/junit.xml"

# Send junit file to shared dir for Data Router Reporter step
cp "${CLUSTER_PATH}/junit.xml" "${SHARED_DIR}"

if [[ ${DIFF_TIME} -le 1800 ]]; then
echo ""
echo " 🚨 The tests finished too quickly (took only: ${DIFF_TIME} sec), pausing here to give us time to debug"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ ref:
default: "false"
documentation: Specify whether to update the test suite name for reporting tools
- name: REPORTPORTAL_CMP
default: "CNV-lp-interop"
default: "lp-ocp-compat--ODF"
documentation: If test mapping is applied, differentiate between the CNV and ODF jobs