Repository navigation
ci: retain test output and generate JUnit artifacts in Prow jobs - #10348
madhoshyagnik wants to merge 1 commit into
Conversation
Currently, CRI-O's Prow integration and e2e jobs run via Ansible playbooks in contrib/test/ci. In ci-fedora-integration, stdout was redirected to a file while only stderr was kept in the live log, and Bats did not produce JUnit XML reports. In ci-e2e, kubetest stdout and stderr were redirected to e2e.log with '&>', resulting in empty output in Ansible task logs upon failure. This change: 1. Updates test/test_runner.sh to generate JUnit reports when REPORT_DIR or ARTIFACT_DIR is set, writing junit_parallel.xml and junit_serial.xml while preserving both parallel and serial exit codes. 2. Adds ARTIFACT_DIR to int_test_env in contrib/test/ci/vars.yml so Bats writes JUnit XML reports to the artifacts directory. 3. Updates contrib/test/ci/integration.yml to stream make localintegration output with tee and set -o pipefail. 4. Updates contrib/test/ci/e2e.yml and e2e-features.yml to stream kubetest output via tee with set -o pipefail and bash executable. 5. Adds junit*.xml to .gitignore. Signed-off-by: Madhosh Yagnik <madhosh1yagnik@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: madhoshyagnik 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 |
|
Hi @madhoshyagnik. Thanks for your PR. I'm waiting for a cri-o member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughCI test commands now stream output to artifact logs and preserve pipeline failures. The test runner can emit separate parallel and serial JUnit reports, runs both suites after a failure, and returns the captured failure status. ChangesCI artifact preservation
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The CI changes preserve live output, failure statuses, and JUnit artifacts for the targeted jobs, so the change is mergeable. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
What type of PR is this?
/kind ci
What this PR does / why we need it:
In CRI-O's Prow jobs driven by playbooks in
contrib/test/ci(ci-fedora-integrationandci-e2e), test output was discarded from live logs and JUnit XML reports were not generated or displayed in Prow:ci-fedora-integration,make localintegration 2>&1 > /tmp/artifacts/testout.txtredirected stdout to a file and only streamed stderr into the live log. Furthermore, Bats was not invoked with JUnit report flags, so Prow's Spyglass JUnit lens showed 0 test results.ci-e2e(ande2e-features.yml), kubetest was invoked with&> {{ artifacts }}/e2e.log, causing Ansible task failures to output"stdout": ""and hiding Ginkgo test progress and failure details from the build logs.This PR addresses this by:
test/test_runner.shto generate JUnit reports (junit_parallel.xmlandjunit_serial.xml) into$REPORT_DIRor$ARTIFACT_DIRwhen set and supported by Bats (--report-formatter junit -o <dir>), while running both parallel and serial suites and preserving failure exit codes.ARTIFACT_DIR: "{{ artifacts }}"toint_test_envincontrib/test/ci/vars.ymlso integration tests write JUnit XML files into the artifact collection path.contrib/test/ci/integration.ymlto pipemake localintegrationoutput totee {{ artifacts }}/testout.txtwithset -o pipefail.contrib/test/ci/e2e.ymlandcontrib/test/ci/e2e-features.ymlto streamkubetestoutput viatee {{ artifacts }}/e2e.logwithset -o pipefailandexecutable: /bin/bash.junit*.xmlto.gitignore.Which issue(s) this PR fixes:
Fixes #10190
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?
Summary by CodeRabbit
Tests
Chores