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 @@ -298,7 +298,7 @@ log_chronyd_status() {
KUBECONFIG=$SHARED_DIR/kubeconfig oc debug node/cnfdf32.telco5gran.eng.rdu2.redhat.com -- chroot /host systemctl status chronyd || true
}


SKIP_OCP_INSTALL="true"
#Set status and run playbooks
status=0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ retry_with_timeout 400 5 kubectl rollout status daemonset linuxptp-daemon -nopen
cd -
echo "running conformance tests from branch ${TEST_BRANCH}"
# always run test from latest upstream
git clone https://github.com/k8snetworkplumbingwg/ptp-operator.git -b "${TEST_BRANCH}" ptp-operator-conformance-test
git clone https://github.com/edcdavid/ptp-operator-upstream.git -b fix-wpc1 ptp-operator-conformance-test

Comment on lines 406 to 409
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify branch exists in the configured/default conformance repo.
PTP_CONFORMANCE_REPO="${PTP_CONFORMANCE_REPO:-https://github.com/edcdavid/ptp-operator-upstream.git}"
PTP_CONFORMANCE_BRANCH="${PTP_CONFORMANCE_BRANCH:-fix-wpc1}"

echo "Checking ${PTP_CONFORMANCE_REPO}#${PTP_CONFORMANCE_BRANCH}"
git ls-remote --heads "${PTP_CONFORMANCE_REPO}" "${PTP_CONFORMANCE_BRANCH}"

Repository: openshift/release

Length of output: 194


🏁 Script executed:

# First, let's see the context around lines 406-409 and understand TEST_BRANCH
sed -n '390,420p' ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh

Repository: openshift/release

Length of output: 991


🏁 Script executed:

grep -n "TEST_BRANCH" ci-operator/step-registry/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh

Repository: openshift/release

Length of output: 664


Remove hardcoded fork/branch and use parameterized TEST_BRANCH instead.

Line 408 hardcodes fix-wpc1 in a non-canonical fork, but line 406 announces testing against ${TEST_BRANCH} (which resolves to main). This inconsistency causes the script to ignore the declared branch parameter, creating a divergence between intent and execution, and introduces a brittle dependency on a personal fork that may disappear or change.

Parameterize the conformance repo and branch to respect the same branch controls used elsewhere in the script:

Suggested fix
 echo "running conformance tests from branch ${TEST_BRANCH}"
 # always run test from latest upstream
-git clone https://github.com/edcdavid/ptp-operator-upstream.git -b fix-wpc1 ptp-operator-conformance-test
+: "${PTP_CONFORMANCE_REPO:=https://github.com/k8snetworkplumbingwg/ptp-operator.git}"
+: "${PTP_CONFORMANCE_BRANCH:=${TEST_BRANCH}}"
+git clone --single-branch --branch "${PTP_CONFORMANCE_BRANCH}" "${PTP_CONFORMANCE_REPO}" ptp-operator-conformance-test
🤖 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/telco5g/ptp/tests/telco5g-ptp-tests-commands.sh`
around lines 406 - 409, The script currently clones a hardcoded fork/branch
("https://github.com/edcdavid/ptp-operator-upstream.git -b fix-wpc1") which
ignores the declared TEST_BRANCH; change the clone to use parameterized
variables (e.g. replace that line with a git clone
"${TEST_CONFORMANCE_REPO:-https://github.com/openshift/ptp-operator-upstream.git}"
-b "${TEST_BRANCH}" ptp-operator-conformance-test) so the repo and branch come
from TEST_CONFORMANCE_REPO and TEST_BRANCH (with sensible defaults) instead of
the hardcoded fork/branch; ensure any references to TEST_BRANCH earlier in the
script match this new clone invocation.

cd ptp-operator-conformance-test

Expand Down Expand Up @@ -469,7 +469,7 @@ mkdir -p $LOG_ARTIFACTS_DIR
export JUNIT_OUTPUT_DIR=${ARTIFACT_DIR}

export PTP_LOG_LEVEL=debug
export SKIP_INTERFACES=eno8303np0,eno8403np1,eno8503np2,eno8603np3,eno12409,eno8303,ens7f0np0,ens7f1np1,eno8403,ens6f0np0,ens6f1np1,eno8303np0,eno8403np1,eno8503np2,eno8603np3
export SKIP_INTERFACES=eno8303np0,eno8403np1,eno8503np2,eno8603np3,eno12409,eno8303,ens7f0np0,ens7f1np1,eno8403,ens6f0np0,ens6f1np1,eno8303np0,eno8403np1,eno8503np2,eno8603np3,eno12399
export PTP_TEST_CONFIG_FILE=${SHARED_DIR}/test-config.yaml

# wait before first run
Expand Down