Skip to content

Add unit tests for isStageRunning - #7316

Merged
khanhtc1202 merged 1 commit into
pipe-cd:masterfrom
vikash7485:test/add-coverage-for-is-stage-running
Sep 3, 2026
Merged

Add unit tests for isStageRunning#7316
khanhtc1202 merged 1 commit into
pipe-cd:masterfrom
vikash7485:test/add-coverage-for-is-stage-running

Conversation

@vikash7485

Copy link
Copy Markdown
Contributor

What this PR does:

Adds comprehensive unit tests for the isStageRunning utility function (web/src/utils/is-stage-running.test.ts).

Why we need it:

isStageRunning is a core utility used by the deployment detail log-viewer (web/src/components/deployments-detail-page/log-viewer/index.tsx) to determine whether an active stage is currently in progress or waiting, controlling the log loading indicator. It lacked automated test coverage across its enum state transitions.

Does this PR introduce a user-facing change?:

No.

  • How are users affected by this change: N/A (Internal test coverage improvement)
  • Is this breaking change: No.
  • How to migrate (if breaking change): N/A.

Signed-off-by: vikash7485 <vikkiraj073@gmail.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 05:30
@vikash7485
vikash7485 requested review from a team as code owners September 2, 2026 05:30
@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site ready!

Name Link
🔨 Latest commit 3cb3ca7
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6a97b46e263e8500084c96e5
😎 Deploy Preview https://deploy-preview-7316--pipecd-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The added tests match the current isStageRunning implementation and provide full coverage across the existing StageStatus enum values without changing runtime behavior.

Pull request overview

This PR adds Jest unit test coverage for the isStageRunning utility used by the web deployment log viewer to decide whether the log component should be in a “loading” state based on the stage status.

Changes:

  • Add a new parameterized unit test (it.each) covering all StageStatus enum values for isStageRunning.
File summaries
File Description
web/src/utils/is-stage-running.test.ts Adds table-driven tests asserting isStageRunning behavior for every StageStatus value.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@khanhtc1202
khanhtc1202 enabled auto-merge (squash) September 3, 2026 03:57
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.72%. Comparing base (959e38b) to head (3cb3ca7).
⚠️ Report is 24 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #7316       +/-   ##
===========================================
+ Coverage   29.75%   40.72%   +10.97%     
===========================================
  Files         601       59      -542     
  Lines       64442     4788    -59654     
===========================================
- Hits        19172     1950    -17222     
+ Misses      43778     2740    -41038     
+ Partials     1492       98     -1394     
Flag Coverage Δ
. ?
.-pkg-app-pipedv1-plugin-analysis 32.16% <ø> (ø)
.-pkg-app-pipedv1-plugin-ecs ?
.-pkg-app-pipedv1-plugin-kubernetes ?
.-pkg-app-pipedv1-plugin-kubernetes_multicluster ?
.-pkg-app-pipedv1-plugin-scriptrun ?
.-pkg-app-pipedv1-plugin-terraform 38.46% <ø> (ø)
.-pkg-app-pipedv1-plugin-wait 33.04% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval ?
.-pkg-plugin-sdk 50.12% <ø> (ø)
.-tool-actions-gh-release ?
.-tool-actions-plan-preview ?
.-tool-codegen-protoc-gen-auth ?

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.

@khanhtc1202
khanhtc1202 merged commit ff62578 into pipe-cd:master Sep 3, 2026
67 checks passed
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to PipeCD, @vikash7485! The changes in this pull request will be part of the upcoming release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants