refactor(constants): migrate tests/network/ to direct submodule imports#5321
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (37)
📝 WalkthroughWalkthroughAll changes redirect constant imports across ChangesNetwork Tests: Constants Import Refactoring
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
Replace all `from utilities.constants import X` in tests/network/ (38 files) with direct submodule imports. No logic changes. Generated-by: Claude Sonnet 4.6 Signed-off-by: vsibirsk <vsibirsk@redhat.com>
d857708 to
0ad7a5b
Compare
|
/approve |
|
/retest all |
|
/retest tox |
1 similar comment
|
/retest tox |
|
/verified |
Test execution plan request detailsCRITICAL: You MUST post an inline review comment on the first changed line of the first file. As an expert software testing engineer, analyze all modified files in this PR and create a targeted test execution plan. Analysis Requirements:
Output rules: Your deliverable: Test Execution Plan
Use these formats:
Real test commands (MANDATORY when changes affect session/runtime code): When the affected code runs at session/collection time (conftest fixtures, pytest plugins,
Example output for a session-startup fix: Guidelines:
Hardware-Related Checks (SR-IOV, GPU, DPDK): When PR modifies fixtures for hardware-specific resources:
CRITICAL WORKFLOW COMPLETION RULES: When responding to this test execution plan request, you MUST follow these rules EXACTLY:
ABSOLUTE PROHIBITIONS (violating these creates empty/meaningless reviews):
Remember: The pull request review is visible to users. Additional comments are redundant noise. CRITICAL — Verification rules for smoke and gating decisions: |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RedHatQE/openshift-virtualization-tests"
pr="5321"
# Current PR head SHA
head_sha="$(gh api "repos/$repo/pulls/$pr" --jq '.head.sha')"
# First changed file + patch
files_json="$(gh api "repos/$repo/pulls/$pr/files?per_page=100")"
first_file="$(jq -r '.[0].filename' <<<"$files_json")"
patch="$(jq -r '.[0].patch // ""' <<<"$files_json")"
# Compute first added line on RIGHT side from unified diff
first_added_line="$(
python - "$patch" <<'PY'
import re, sys
patch = sys.argv[1].splitlines()
right = None
for line in patch:
if line.startswith('@@'):
m = re.search(r'\+(\d+)(?:,(\d+))?', line)
if m:
right = int(m.group(1))
continue
if right is None:
continue
if line.startswith('+') and not line.startswith('+++'):
print(right)
raise SystemExit(0)
if not line.startswith('-'):
right += 1
print("")
PY
)"
if [[ -z "$first_file" || -z "$first_added_line" ]]; then
echo "Unable to determine first changed file/line" >&2
exit 1
fi
# Check whether a matching inline comment by CodeRabbit already exists on this exact path/line for current head
existing_count="$(
gh api "repos/$repo/pulls/$pr/comments?per_page=100" --paginate |
jq --arg path "$first_file" --argjson line "$first_added_line" --arg sha "$head_sha" '
map(select(
.path == $path and
.line == $line and
.commit_id == $sha and
(.user.login == "coderabbitai[bot]" or .user.login == "coderabbitai")
)) | length'
)"
if [[ "$existing_count" -eq 0 ]]; then
body=$'**Test Execution Plan**\n\n- **Run smoke tests: False** — This PR only rewires constant imports inside `tests/network/` from `utilities.constants` to direct submodule imports. No utility/lib implementation changed, and no fixture behavior, parametrization, teardown path, or test logic changed, so there is no verified dependency path from any smoke-marked test to a modified runtime symbol.\n- **Run gating tests: False** — For the same reason, there is no verified dependency path from any gating-marked test to a modified runtime symbol.\n\n**Affected tests to run**\n- `tests/network/` (collection verification only)\n\n**Real tests (cluster required)**\nError path (the fix):\n`uv run pytest -rA -s -o log_cli=true --tc-file=tests/global_config_amd64.py --tc-format=python --cluster-sanity-skip-check --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization --skip-deprecated-api-test tests/network/ --collect-only`\nExpected: collection completes successfully with `201/212 tests collected (11 deselected)` and no import errors from the direct submodule imports.\n\nHappy path (regression):\n`uv run pytest -rA -s -o log_cli=true --tc-file=tests/global_config_amd64.py --tc-format=python --cluster-sanity-skip-check --storage-class-matrix=ocs-storagecluster-ceph-rbd-virtualization --skip-deprecated-api-test tests/network/ --collect-only`\nExpected: same collection result as the pre-refactor baseline; no change in discovered tests or deselections.'
gh api "repos/$repo/pulls/$pr/reviews" \
--method POST \
--field commit_id="$head_sha" \
--field body="" \
--field event="COMMENT" \
--field "comments[][path]=$first_file" \
--field "comments[][line]=$first_added_line" \
--field "comments[][side]=RIGHT" \
--field "comments[][body]=$body" >/dev/null
fiLength of output: 3511
|
|
Clean rebase detected — no code changes compared to previous head ( |
|
New container for quay.io/openshift-cnv/openshift-virtualization-tests:latest published |
What this PR does / why we need it:
Replace all
from utilities.constants import Xin tests/network/ (38 files) with direct submodule imports. No logic changes.Generated-by: Claude Sonnet 4.6
Which issue(s) this PR fixes:
Special notes for reviewer:
This is a next PR in a series.
https://redhat.atlassian.net/browse/CNV-80952 and a follow up of #5188
jira-ticket:
https://redhat.atlassian.net/browse/CNV-89566
Summary by CodeRabbit