Skip to content

Add rollout deployment utility edge-case tests - #310

Merged
keithchong merged 1 commit into
redhat-developer:mainfrom
trdoyle81:GITOPS-10538-rollout-deployment-utilites
Oct 28, 2026
Merged

keithchong merged 1 commit into
redhat-developer:mainfrom
trdoyle81:GITOPS-10538-rollout-deployment-utilites

Conversation

@trdoyle81

@trdoyle81 trdoyle81 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Adds edge-case unit tests for rollout deployment utilities.

Covers:

  • Pods with missing containerStatuses / unrecognised wait reasons
  • Replica set Progressing (under-replicated) and scale-down-deadline annotation
    Baseline Terminating / Pending / Running / Succeeded / CrashLoopBackOff / ScaledDown coverage was already in PR Add unit test infrastructure and inline snapshot tests #245.

Jira:
https://redhat.atlassian.net/browse/GITOPS-10538

Note:
Will need to be ported to release-4.18 also.

Run tests:
$ pnpm test -- src/gitops/components/shared/pod-utils.test.ts src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts

@openshift-ci
openshift-ci Bot requested review from keithchong and wtam2018 October 27, 2026 12:14
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 8d7c33e5-f8c3-450a-955f-b6b8dee48b2e
Commits

Reviewing files that changed from the base of the PR and between 3ee61a2 and 623bcb1.

Files selected for processing: 2
  • src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts
  • src/gitops/components/shared/pod-utils.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Tests
    • Added coverage for rollout status reporting when replica counts differ and only one replica is ready and available.
    • Added coverage for displaying a replica set’s scale-down deadline.
    • Added coverage for pod status when container statuses are missing or a container is waiting to be created.

Tests were added for ReplicaSet status and scale-down deadline information, and for pod status when container statuses are missing or a container has the waiting reason ContainerCreating.

Changes: ReplicaSet information

Layer / File(s) Summary
ReplicaSet information assertions
src/gitops/components/rollout/revisions/ReplicaSetInfo.test.ts
Tests cover "Progressing" status for mismatched replica counts and the scale-down-deadline annotation value.

Pod status

Layer / File(s) Summary
Pod status assertions
src/gitops/components/shared/pod-utils.test.ts
Tests expect "Not Ready" when containerStatuses is missing or an unready container has the waiting reason ContainerCreating.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 623bc

This change only adds edge-case unit tests for pod status and ReplicaSet info, with no production behavior change. No merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the added edge-case tests for rollout deployment utilities.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description directly matches the added edge-case unit tests for pod status and ReplicaSet utilities, and it identifies the test command and Jira issue.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 14.16%. Comparing base (3bd1dab) to head (623bcb1).
⚠️ Report is 73 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #310      +/-   ##
==========================================
+ Coverage   11.30%   14.16%   +2.86%     
==========================================
  Files         169      192      +23     
  Lines        6679     7533     +854     
  Branches     2235     2507     +272     
==========================================
+ Hits          755     1067     +312     
- Misses       5923     6217     +294     
- Partials        1      249     +248     
Flag Coverage Δ
unit-tests 14.16% <ø> (+2.86%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@keithchong keithchong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great to see getReplicaSetInfo and getPodStatus being tested.

@keithchong
keithchong merged commit 173040c into redhat-developer:main Oct 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants