Skip to content

feat(ci): skip pod log collection on success, write TESTS_PASSED marker - #4267

Merged
openshift-merge-bot[bot] merged 3 commits into
mainfrom
qe/conditional-gather-skip-on-success
Feb 26, 2026
Merged

feat(ci): skip pod log collection on success, write TESTS_PASSED marker#4267
openshift-merge-bot[bot] merged 3 commits into
mainfrom
qe/conditional-gather-skip-on-success

Conversation

@gustavolira

Copy link
Copy Markdown
Member

Summary

  • Skip save_all_pod_logs in testing::check_and_test() when tests pass — avoids iterating all pods in the namespace on successful runs
  • Write TESTS_PASSED marker to $SHARED_DIR on clean exit (OVERALL_RESULT=0) so the openshift/release post-phase steps (gather-extra, must-gather) can detect success and skip heavy artifact collection (~8 min savings)

Changes

.ibm/pipelines/lib/testing.shtesting::check_and_test():

  • Track deployment failure with local _deployment_failed flag
  • Only call save_all_pod_logs when deployment failed or STATUS_TEST_FAILED is true
  • On success, log a skip message instead

.ibm/pipelines/cleanup.shcleanup():

  • After determining OVERALL_RESULT, write $SHARED_DIR/TESTS_PASSED marker if result is 0
  • This marker enables a follow-up PR to openshift/release to conditionally skip gather-extra and must-gather

Follow-up

A separate PR to openshift/release is needed to check for the TESTS_PASSED marker in the gather-extra step and skip collection when present. That PR will unlock the full ~7-8 min savings per successful PR run.

Test plan

  • Verify on a successful PR run: pod log collection is skipped, TESTS_PASSED marker exists in $SHARED_DIR
  • Verify on a failed PR run: pod logs are still collected, TESTS_PASSED marker is NOT written
  • Verify on deployment failure: pod logs collected by check_backstage_running + check_and_test failure path
  • No regression in JUnit XML or Playwright artifact collection (those are handled separately in run_tests)

Ref: RHIDP-12291

🤖 Generated with Claude Code

…ccess

On successful PR runs, save_all_pod_logs in testing::check_and_test was
collecting logs from every pod in the namespace unconditionally. This adds
a condition to skip collection when tests pass, and writes a TESTS_PASSED
marker file to $SHARED_DIR on clean exit so that the openshift/release
post-phase (gather-extra, must-gather) can skip heavy artifact collection.

Ref: RHIDP-12291

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci
openshift-ci Bot requested review from jrichter1 and psrna February 18, 2026 19:30
@github-actions

Copy link
Copy Markdown
Contributor

gustavolira added a commit to gustavolira/release that referenced this pull request Feb 18, 2026
Replace `chain: gather` with an RHDH-specific gather step for the
e2e-ocp-helm PR check job. The new step checks for a TESTS_PASSED
marker in $SHARED_DIR (written by the RHDH test scripts on exit 0).

On success: skips must-gather and gather-extra entirely (~8 min savings).
On failure: runs must-gather and collects essential cluster state
(operators, nodes, pods, events, RHDH namespace logs).

This change only affects the RHDH e2e-ocp-helm PR job. Nightly jobs
retain the full generic gather chain.

Companion PR: redhat-developer/rhdh#4267
Ref: RHIDP-12291

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gustavolira added a commit to gustavolira/release that referenced this pull request Feb 18, 2026
Replace `chain: gather` with an RHDH-specific gather step for the
e2e-ocp-helm PR check job. The new step checks for a TESTS_PASSED
marker in $SHARED_DIR (written by the RHDH test scripts on exit 0).

On success: skips must-gather and gather-extra entirely (~8 min savings).
On failure: runs must-gather and collects essential cluster state
(operators, nodes, pods, events, RHDH namespace logs).

This change only affects the RHDH e2e-ocp-helm PR job. Nightly jobs
retain the full generic gather chain.

Companion PR: redhat-developer/rhdh#4267
Ref: RHIDP-12291

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gustavolira added a commit to gustavolira/release that referenced this pull request Feb 18, 2026
Replace `chain: gather` with an RHDH-specific gather step for the
e2e-ocp-helm PR check job. The new step checks for a TESTS_PASSED
marker in $SHARED_DIR (written by the RHDH test scripts on exit 0).

On success: skips must-gather and gather-extra entirely (~8 min savings).
On failure: runs must-gather and collects essential cluster state
(operators, nodes, pods, events, RHDH namespace logs).

This change only affects the RHDH e2e-ocp-helm PR job. Nightly jobs
retain the full generic gather chain.

Companion PR: redhat-developer/rhdh#4267
Ref: RHIDP-12291

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread .ibm/pipelines/lib/testing.sh Outdated
check_backstage_running already calls save_all_pod_logs internally
before returning false. Only call save_all_pod_logs when deployment
succeeded but tests failed — skip both when deployment failed (already
collected) and when tests passed (not needed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

Comment thread .ibm/pipelines/lib/testing.sh Outdated
gustavolira added a commit to gustavolira/release that referenced this pull request Feb 19, 2026
Replace `chain: gather` with an RHDH-specific gather step for the
e2e-ocp-helm PR check job. The new step checks for a TESTS_PASSED
marker in $SHARED_DIR (written by the RHDH test scripts on exit 0).

On success: skips must-gather and gather-extra entirely (~8 min savings).
On failure: runs must-gather and collects essential cluster state
(operators, nodes, pods, events, RHDH namespace logs).

This change only affects the RHDH e2e-ocp-helm PR job. Nightly jobs
retain the full generic gather chain.

Companion PR: redhat-developer/rhdh#4267
Ref: RHIDP-12291

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per review feedback: check_backstage_running is only called from
check_and_test, so pod log collection belongs in the caller. This
removes the _deployment_failed flag and centralizes the decision
in check_and_test using STATUS_TEST_FAILED/STATUS_FAILED_TO_DEPLOY.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

@sonarqubecloud

Copy link
Copy Markdown

@subhashkhileri

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci

openshift-ci Bot commented Feb 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: subhashkhileri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kadel

kadel commented Feb 23, 2026

Copy link
Copy Markdown
Member

/retest

@openshift-merge-bot
openshift-merge-bot Bot merged commit 7cbfddd into main Feb 26, 2026
18 checks passed
@openshift-merge-bot
openshift-merge-bot Bot deleted the qe/conditional-gather-skip-on-success branch February 26, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants