Skip to content

add test coverage for provision error handling [SDCICD-1752]#3227

Open
christophermancini wants to merge 1 commit into
openshift:mainfrom
christophermancini:cm/exit
Open

add test coverage for provision error handling [SDCICD-1752]#3227
christophermancini wants to merge 1 commit into
openshift:mainfrom
christophermancini:cm/exit

Conversation

@christophermancini
Copy link
Copy Markdown
Contributor

@christophermancini christophermancini commented May 5, 2026

Summary

Adds test coverage for provision command error handling to prevent regression of the fix from PR #3122.

Relates to: SDCICD-1752

Changes

  • Refactored provision command to be testable (no logic changes)
  • Added handleProvisionError() function with test coverage
  • Added Provisioner interface for dependency injection
  • Tests verify correct exit codes for all error scenarios

Test Coverage

✓ Success → exit 0
✓ Reserve full → exit 0 (treated as success)
✓ OIDC failures → exit 1 (SDCICD-1752)
✓ IAM errors → exit 1 (SDCICD-1752)
✓ Cluster timeouts → exit 1
✓ Health check failures → exit 1

All tests pass in 0.016s (7 test cases)

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

There are test jobs defined for this repository which are not configured to run automatically. Comment /test ? to see a list of all defined jobs. Review these jobs and use /test <job> to manually trigger jobs most likely to be impacted by the proposed changes.Comment /pipeline required to trigger all required & necessary jobs.

@openshift-ci openshift-ci Bot requested review from YiqinZhang and minlei98 May 5, 2026 13:36
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christophermancini

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 5, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b054dfbe-24ec-49ac-925d-bfcf66cc6f10

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread scripts/parameterized-job.sh Outdated
Extracted error handling logic into testable functions and added
comprehensive unit tests to verify exit code behavior for different
error scenarios.

Changes:
- Added Provisioner interface for dependency injection
- Extracted handleProvisionError() function for isolated testing
- Added runWithProvisioner() to support mocking in tests
- Added comprehensive test coverage for error scenarios

Tests verify correct exit codes for:
- Success (exit 0)
- Reserve full (exit 0 - treated as success)
- OIDC config failures (exit 1) - SDCICD-1752
- IAM permission errors (exit 1) - SDCICD-1752
- Cluster timeouts (exit 1)
- Health check failures (exit 1)

Note: The underlying error handling logic remains unchanged from
PR openshift#3122 which already correctly handles these scenarios. This commit
adds tests to prevent regression and improve code maintainability.

All tests passing: 7 test cases in 0.016s

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

@christophermancini: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/code-quality-checks a949c80 link true /test code-quality-checks

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@christophermancini christophermancini changed the title Fix shell scripts to propagate exit codes from osde2e containers [SDCICD-1752] add test coverage for provision error handling [SDCICD-1752] May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants