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 @@ -30,14 +30,15 @@ resources:
cpu: 100m
memory: 200Mi
tests:
- as: cr-quay-e2e-tests-aws
- as: cr--quay--e2e-tests-aws
cron: 0 3,15 * * *
steps:
cluster_profile: aws-cspi-qe
env:
BASE_DOMAIN: cspilp.interop.ccitredhat.com
COMPUTE_NODE_TYPE: m5.4xlarge
CSO_CHANNEL: stable-3.16
DR__RP__CR_COMP_NAME: lp-ocp-compat--Quay
FIREWATCH_CONFIG: |
{
"failure_rules":
Expand All @@ -57,7 +58,6 @@ tests:
QBO_CHANNEL: stable-3.16
QUAY_OPERATOR_CHANNEL: stable-3.16
QUAY_VERSION: "3.16"
REPORTPORTAL_CMP: Quay-lp-interop
USER_TAGS: |
scenario quay
post:
Expand Down Expand Up @@ -86,6 +86,7 @@ tests:
BASE_DOMAIN: cspilp.interop.ccitredhat.com
COMPUTE_NODE_TYPE: m5.4xlarge
CSO_CHANNEL: stable-3.16
DR__RP__CR_COMP_NAME: lp-ocp-compat--Quay
FIPS_ENABLED: "true"
FIREWATCH_CONFIG: |
{
Expand All @@ -105,7 +106,6 @@ tests:
QBO_CHANNEL: stable-3.16
QUAY_OPERATOR_CHANNEL: stable-3.16
QUAY_VERSION: "3.16"
REPORTPORTAL_CMP: Quay-lp-interop
USER_TAGS: |
scenario quay
post:
Expand All @@ -124,6 +124,7 @@ tests:
BASE_DOMAIN: quayqe.devcluster.openshift.com
COMPUTE_NODE_TYPE: m5.4xlarge
CSO_CHANNEL: stable-3.16
DR__RP__CR_COMP_NAME: lp-ocp-compat--Quay
QBO_CHANNEL: stable-3.16
QUAY_OPERATOR_CHANNEL: stable-3.16
QUAY_OPERATOR_SOURCE: redhat-operators
Expand All @@ -142,4 +143,4 @@ zz_generated_metadata:
branch: master
org: quay
repo: quay-tests
variant: ocp-4.22-quay-lp-interop
variant: ocp-4.22-quay-lpGA-lp-ocp-compat
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ periodics:
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws-cspi-qe
ci-operator.openshift.io/variant: ocp-4.22-quay-lp-interop
ci-operator.openshift.io/variant: ocp-4.22-quay-lpGA-lp-ocp-compat
ci.openshift.io/generator: prowgen
job-release: "4.22"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-quay-quay-tests-master-ocp-4.22-quay-lp-interop-aws-fips
name: periodic-ci-quay-quay-tests-master-ocp-4.22-quay-lpGA-lp-ocp-compat-aws-fips
reporter_config:
slack:
channel: '#quay-qe'
Expand All @@ -229,7 +229,7 @@ periodics:
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --target=aws-fips
- --variant=ocp-4.22-quay-lp-interop
- --variant=ocp-4.22-quay-lpGA-lp-ocp-compat
command:
- ci-operator
env:
Expand Down Expand Up @@ -304,11 +304,11 @@ periodics:
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws-cspi-qe
ci-operator.openshift.io/variant: ocp-4.22-quay-lp-interop
ci-operator.openshift.io/variant: ocp-4.22-quay-lpGA-lp-ocp-compat
ci.openshift.io/generator: prowgen
job-release: "4.22"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-quay-quay-tests-master-ocp-4.22-quay-lp-interop-cr-quay-e2e-tests-aws
name: periodic-ci-quay-quay-tests-master-ocp-4.22-quay-lpGA-lp-ocp-compat-cr--quay--e2e-tests-aws
spec:
containers:
- args:
Expand All @@ -318,8 +318,8 @@ periodics:
- --oauth-token-path=/usr/local/github-credentials/oauth
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --target=cr-quay-e2e-tests-aws
- --variant=ocp-4.22-quay-lp-interop
- --target=cr--quay--e2e-tests-aws
- --variant=ocp-4.22-quay-lpGA-lp-ocp-compat
command:
- ci-operator
env:
Expand Down Expand Up @@ -394,11 +394,11 @@ periodics:
labels:
ci-operator.openshift.io/cloud: aws
ci-operator.openshift.io/cloud-cluster-profile: aws-quay-qe
ci-operator.openshift.io/variant: ocp-4.22-quay-lp-interop
ci-operator.openshift.io/variant: ocp-4.22-quay-lpGA-lp-ocp-compat
ci.openshift.io/generator: prowgen
job-release: "4.22"
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: periodic-ci-quay-quay-tests-master-ocp-4.22-quay-lp-interop-quay-e2e-tests-quay316-ocp422-aws-s3
name: periodic-ci-quay-quay-tests-master-ocp-4.22-quay-lpGA-lp-ocp-compat-quay-e2e-tests-quay316-ocp422-aws-s3
spec:
containers:
- args:
Expand All @@ -409,7 +409,7 @@ periodics:
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --target=quay-e2e-tests-quay316-ocp422-aws-s3
- --variant=ocp-4.22-quay-lp-interop
- --variant=ocp-4.22-quay-lpGA-lp-ocp-compat
command:
- ci-operator
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ set -o nounset
set -o errexit
set -o pipefail

if [ "${MAP_TESTS}" = "true" ]; then
eval "$(
typeset -a _fURL=()
type -t wget 1>/dev/null && _fURL=(wget -qO-) || _fURL=(curl -fsSL)
"${_fURL[@]}" \
https://raw.githubusercontent.com/RedHatQE/OpenShift-LP-QE--Tools/refs/heads/main/libs/bash/ci-operator/interop/common/ExitTrap--PostProcessPrep.sh
)"; trap '
LP_IO__ET_PPP__NEW_TS_NAME="${DR__RP__CR_COMP_NAME}--%s" \
ExitTrap--PostProcessPrep junit--quay-tests__cso-qe-test__quay-tests-cso-qe-test.xml
' EXIT
fi

#Install CSO
CSO_CHANNEL="$CSO_CHANNEL"
CSO_SOURCE="$CSO_SOURCE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ ref:
documentation: |-
Execute CSO QE testing
env:
- name: DR__RP__CR_COMP_NAME
default: "lp-ocp-compat--Quay"
documentation: ReportPortal Component Readiness component name for junit remapping
- name: MAP_TESTS
default: "false"
documentation: Specify whether to update the test suite name for reporting tools
- name: CSO_CHANNEL
documentation: The container security operator channel
default: "stable-3.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ set -o nounset
set -o errexit
set -o pipefail

if [ "${MAP_TESTS}" = "true" ]; then
eval "$(
typeset -a _fURL=()
type -t wget 1>/dev/null && _fURL=(wget -qO-) || _fURL=(curl -fsSL)
"${_fURL[@]}" \
https://raw.githubusercontent.com/RedHatQE/OpenShift-LP-QE--Tools/refs/heads/main/libs/bash/ci-operator/interop/common/ExitTrap--PostProcessPrep.sh
)"; trap '
LP_IO__ET_PPP__NEW_TS_NAME="${DR__RP__CR_COMP_NAME}--%s" \
ExitTrap--PostProcessPrep junit--quay-tests__deploy-quay-aws-s3__quay-tests-deploy-quay-aws-s3.xml
' EXIT
fi

function archive_pod_info() {
local ns="quay-enterprise"
echo "Archiving pod status and logs from namespace ${ns}..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ref:
tag: latest
commands: quay-tests-deploy-quay-aws-s3-commands.sh
timeout: 8h0m0s
grace_period: 10m
resources:
requests:
cpu: 10m
Expand All @@ -21,6 +22,12 @@ ref:
documentation: |-
Deploy Quay Operator and Quay
env:
- name: DR__RP__CR_COMP_NAME
default: "lp-ocp-compat--Quay"
documentation: ReportPortal Component Readiness component name for junit remapping
- name: MAP_TESTS
default: "false"
documentation: Specify whether to update the test suite name for reporting tools
- name: QUAY_OPERATOR_CHANNEL
documentation: The quay operator channel
default: "stable-3.12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
set -o nounset
set -o pipefail

if [ "${MAP_TESTS}" = "true" ]; then
eval "$(
typeset -a _fURL=()
type -t wget 1>/dev/null && _fURL=(wget -qO-) || _fURL=(curl -fsSL)
"${_fURL[@]}" \
https://raw.githubusercontent.com/RedHatQE/OpenShift-LP-QE--Tools/refs/heads/main/libs/bash/ci-operator/interop/common/ExitTrap--PostProcessPrep.sh
)"; trap '
LP_IO__ET_PPP__NEW_TS_NAME="${DR__RP__CR_COMP_NAME}--%s" \
ExitTrap--PostProcessPrep junit--quay-tests__qbo-qe-test__quay-tests-qbo-qe-test.xml
' EXIT
fi

QBO_RC=0

(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ ref:
documentation: |-
Execute QBO QE testing
env:
- name: DR__RP__CR_COMP_NAME
default: "lp-ocp-compat--Quay"
documentation: ReportPortal Component Readiness component name for junit remapping
- name: MAP_TESTS
default: "false"
documentation: Specify whether to update the test suite name for reporting tools
- name: QBO_CHANNEL
documentation: The quay bridge operator channel
default: "stable-3.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,38 @@

set -euo pipefail

#Create Artifact Directory
ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}
mkdir -p $ARTIFACT_DIR

function copyArtifacts {
typeset junitPrefix="junit_"
cp -r ./cypress/results/* "$ARTIFACT_DIR" || true

for file in "$ARTIFACT_DIR"/*; do
if [[ ! "$(basename "$file")" =~ ^"$junitPrefix" ]]; then
result_file="$ARTIFACT_DIR"/"$junitPrefix""$(basename "$file")"
mv "$file" "$result_file"
fi
done
cp -r ./cypress/videos/* "$ARTIFACT_DIR" || true
Comment on lines +7 to +19

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Skip unmatched artifact paths.

cp tolerates missing Cypress results, but an unmatched "$ARTIFACT_DIR"/* remains a literal path in Bash. The loop then calls mv on that nonexistent path. A run without results can fail from the EXIT trap.

Proposed fix
- mkdir -p $ARTIFACT_DIR
+ mkdir -p "$ARTIFACT_DIR"
 
     for file in "$ARTIFACT_DIR"/*; do
+        [[ -e "$file" ]] || continue
         if [[ ! "$(basename "$file")" =~ ^"$junitPrefix" ]]; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
mkdir -p $ARTIFACT_DIR
function copyArtifacts {
typeset junitPrefix="junit_"
cp -r ./cypress/results/* "$ARTIFACT_DIR" || true
for file in "$ARTIFACT_DIR"/*; do
if [[ ! "$(basename "$file")" =~ ^"$junitPrefix" ]]; then
result_file="$ARTIFACT_DIR"/"$junitPrefix""$(basename "$file")"
mv "$file" "$result_file"
fi
done
cp -r ./cypress/videos/* "$ARTIFACT_DIR" || true
mkdir -p "$ARTIFACT_DIR"
function copyArtifacts {
typeset junitPrefix="junit_"
cp -r ./cypress/results/* "$ARTIFACT_DIR" || true
for file in "$ARTIFACT_DIR"/*; do
[[ -e "$file" ]] || continue
if [[ ! "$(basename "$file")" =~ ^"$junitPrefix" ]]; then
result_file="$ARTIFACT_DIR"/"$junitPrefix""$(basename "$file")"
mv "$file" "$result_file"
fi
done
cp -r ./cypress/videos/* "$ARTIFACT_DIR" || true
🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 7-7: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ci-operator/step-registry/quay-tests/test-quay-e2e/quay-tests-test-quay-e2e-commands.sh`
around lines 7 - 19, Update copyArtifacts so the artifact-renaming loop skips
unmatched glob paths before calling basename or mv, while preserving the
existing behavior for actual artifacts and runs with no Cypress results.

Source: Linters/SAST tools

}

if [ "${MAP_TESTS}" = "true" ]; then
eval "$(
typeset -a _fURL=()
type -t wget 1>/dev/null && _fURL=(wget -qO-) || _fURL=(curl -fsSL)
"${_fURL[@]}" \
https://raw.githubusercontent.com/RedHatQE/OpenShift-LP-QE--Tools/refs/heads/main/libs/bash/ci-operator/interop/common/ExitTrap--PostProcessPrep.sh
)"; trap '
copyArtifacts
LP_IO__ET_PPP__NEW_TS_NAME="${DR__RP__CR_COMP_NAME}--%s" \
ExitTrap--PostProcessPrep junit--quay-tests__test-quay-e2e__quay-tests-test-quay-e2e.xml
' EXIT
else
trap copyArtifacts EXIT
fi

#Set Kubeconfig:
echo "Quay version is ${QUAY_VERSION}"
QUAY_VERSION_THRESHOLD="3.16"
Expand All @@ -19,78 +51,9 @@ oc version
terraform version
(cp -L $KUBECONFIG /tmp/kubeconfig || true) && export KUBECONFIG_PATH=/tmp/kubeconfig

#Create Artifact Directory:
ARTIFACT_DIR=${ARTIFACT_DIR:=/tmp/artifacts}
mkdir -p $ARTIFACT_DIR
original_results="${ARTIFACT_DIR}/original_results/"
mkdir "${original_results}" || true

function install_yq() {
# Install yq manually if not found in image
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

# Verify installation
cmd_yq="$(/tmp/bin/yq --version 2>/dev/null || true)"
if [ -n "$cmd_yq" ]; then
echo "yq version: $cmd_yq"
else
# Skip test mapping since yq isn't available
export MAP_TESTS="false"
fi
}

function mapTestsForComponentReadiness() {
if [[ $MAP_TESTS == "true" ]]; then
results_file="${1}"
echo "Patching Tests Result File: ${results_file}"
if [ -f "${results_file}" ]; then
echo "Mapping Test Suite Name To: Quay-lp-interop"
/tmp/bin/yq eval -px -ox -iI0 '.testsuites.testsuite[]."+@name"="Quay-lp-interop"' $results_file || echo "Warning: yq failed for ${results_file}, debug manually" >&2
fi
fi
}


function copyArtifacts {
JUNIT_PREFIX="junit_"
cp -r ./cypress/results/* $ARTIFACT_DIR

if [[ $MAP_TESTS == "true" ]]; then
# If needed, install yq before loop
install_yq
fi

for file in "$ARTIFACT_DIR"/*; do
if [[ ! "$(basename "$file")" =~ ^"$JUNIT_PREFIX" ]]; then
result_file="$ARTIFACT_DIR"/"$JUNIT_PREFIX""$(basename "$file")"
mv "$file" $result_file

if [[ $MAP_TESTS == "true" ]]; then
echo "Collecting original results in ${original_results}"
# Keep a copy of all the original Junit files before modifying them
cp -r $result_file "${original_results}" || echo "Warning: couldn't copy original file ${results_file}" >&2

# Map tests if needed for related use cases
mapTestsForComponentReadiness "${result_file}"

# Send junit file to shared dir for Data Router Reporter step
cp -r $result_file $SHARED_DIR || echo "Warning: couldn't send result file to SHARED_DIR" >&2
fi
fi
done
cp -r ./cypress/videos/* $ARTIFACT_DIR
}

# Install Dependcies defined in packages.json
npm install || true

#Finally Copy the Junit Testing XML files and Screenshots to /tmp/artifacts
trap copyArtifacts EXIT

# Cypress Doc https://docs.cypress.io/guides/references/proxy-configuration
if [ "${QUAY_PROXY}" = "true" ]; then
HTTPS_PROXY=$(cat $SHARED_DIR/proxy_public_url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ref:
- name: QUAY_VERSION
documentation: Quay version
default: "3.16"
- name: DR__RP__CR_COMP_NAME
default: "lp-ocp-compat--Quay"
documentation: ReportPortal Component Readiness component name for junit remapping
- name: MAP_TESTS
default: "false"
documentation: Specify whether to update the test suite name for reporting tools