Add JUnit report and migrate to external CI image#79900
Conversation
…e to external CI image - Build cli-plus-tools image from external Dockerfile in redhat-chaos/lp-chaos and promote it to ci/lp-chaos-images namespace - Add JUnit XML report generation using Python stdlib (xml.etree.ElementTree) replacing HEREDOC approach for proper XML construction and escaping - Derive step_id from BASH_SOURCE[0] to correctly identify the step in the report filename and test case name - Make testsuite and testcase names configurable via LPC_LP_CNV__JUNIT__SUITE_NAME and LPC_LP_CNV__JUNIT__CASE_NAME env vars following team naming convention - Add grace_period: 60s to allow report generation before pod termination Co-authored-by: Wei Liu <weiliu@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughRefactors the ChangesLP-CNV VM Snapshot Step Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: krisnababu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with 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.
Inline comments:
In
`@ci-operator/step-registry/redhat-lp-chaos/lp/cnv/vm/snapshot/redhat-lp-chaos-lp-cnv-vm-snapshot-commands.sh`:
- Around line 12-41: The heredoc currently interpolates shell variables into the
embedded Python (e.g. step_id, duration, exit_code, out_file, suite_name,
case_name) which can break/enable injection; stop shell expansion by quoting the
delimiter (use 'PYEOF') and have the Python code read values from os.environ
(os.environ.get("LPC_LP_CNV__JUNIT__SUITE_NAME", ...)) or sys.argv instead of
relying on ${...} inside the script; update the Python variables suite_name and
case_name to use os.environ.get(..., default) and parse
step_id/duration/exit_code/out_file from env/argv so the shell no longer injects
raw strings into the source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: c0f76890-0d26-4329-a34f-743f43e5c160
⛔ Files ignored due to path filters (1)
ci-operator/jobs/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main-postsubmits.yamlis excluded by!ci-operator/jobs/**
📒 Files selected for processing (3)
ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp4.21-nightly--cnv-4.21-stable-cnvcases--aws.yamlci-operator/step-registry/redhat-lp-chaos/lp/cnv/vm/snapshot/redhat-lp-chaos-lp-cnv-vm-snapshot-commands.shci-operator/step-registry/redhat-lp-chaos/lp/cnv/vm/snapshot/redhat-lp-chaos-lp-cnv-vm-snapshot-ref.yaml
|
[REHEARSALNOTIFIER]
Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/pj-rehearse periodic-ci-redhat-chaos-lp-chaos-main-ocp4.21-nightly--cnv-4.21-stable-cnvcases--aws-lp-chaos--cnv--node-outage |
|
@krisnababu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
@krisnababu: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/pj-rehearse periodic-ci-redhat-chaos-lp-chaos-main-ocp4.21-nightly--cnv-4.21-stable-cnvcases--aws-lp-chaos--cnv--node-outage |
|
@krisnababu: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
What this PR does
cli-plus-toolsimage from an external Dockerfile inredhat-chaos/lp-chaosand promotes it to the
ci/lp-chaos-imagesnamespaceredhat-lp-chaos-lp-cnv-vm-snapshotstepusing Python stdlib (
xml.etree.ElementTree) instead of shell HEREDOC, ensuringproper XML construction and attribute escaping
step_idfromBASH_SOURCE[0]so the report filename and test case namecorrectly reflect the step name
LPC_LP_CNV__JUNIT__SUITE_NAMEand
LPC_LP_CNV__JUNIT__CASE_NAMEenv vars, following the team naming conventiongrace_period: 60sto allow the JUnit report to be written before pod terminationNotes for reviewers
quay.io/openshift/ci:ocp_4.20_clibase image access is restricted locally so this could not be verified pre-PR.
The rehearsal run will confirm availability. If Python3 is absent, a follow-up PR
to
redhat-chaos/lp-chaosaddingpython3toDockerfile.cli-plus-toolswill be raised.Summary by CodeRabbit
This PR updates the OpenShift CI configuration for the redhat-chaos/lp-chaos repository to improve test reporting and externalize container image definitions:
Container Image Changes:
cli-plus-toolsimage build from an inline Dockerfile definition to an external Dockerfile located atimage/container/ocp-test/Dockerfile.cli-plus-tools. The image continues to be promoted to theci/lp-chaos-imagesnamespace.JUnit Report Generation:
redhat-lp-chaos-lp-cnv-vm-snapshotstep using Python's standardxml.etree.ElementTreelibrary for proper XML construction and attribute escaping.${ARTIFACT_DIR}/junit_${step_id}.xmlwith step name derived from the script filename.Step Configuration:
LPC_LP_CNV__JUNIT__SUITE_NAMEandLPC_LP_CNV__JUNIT__CASE_NAMEenvironment variables to align with team naming conventions.grace_period: 60sto allow the JUnit report to be written before pod termination.These changes enhance the chaos testing workflow by producing CI-parseable test reports while modernizing how the build image is managed.