Skip to content

scorecard example for backend tests#3414

Draft
teknaS47 wants to merge 1 commit into
redhat-developer:mainfrom
teknaS47:ssaikia/RHIDP-14185-startTestBackend-spike
Draft

scorecard example for backend tests#3414
teknaS47 wants to merge 1 commit into
redhat-developer:mainfrom
teknaS47:ssaikia/RHIDP-14185-startTestBackend-spike

Conversation

@teknaS47

@teknaS47 teknaS47 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

RHIDP-14185

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

@rhdh-gh-app

rhdh-gh-app Bot commented Jun 16, 2026

Copy link
Copy Markdown

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-scorecard-backend

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-scorecard-backend workspaces/scorecard/plugins/scorecard-backend none v2.7.9

@github-actions

Copy link
Copy Markdown
Contributor

This pull request adds a new top-level directory under workspaces/. Please follow Submitting a Pull Request for a New Workspace in CONTRIBUTING.md.

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 16, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:27 AM UTC · Completed 10:35 AM UTC
Commit: e9efe2e · View workflow run →

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.03%. Comparing base (d37da53) to head (ee951e0).
⚠️ Report is 44 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3414      +/-   ##
==========================================
+ Coverage   54.00%   54.03%   +0.02%     
==========================================
  Files        2404     2403       -1     
  Lines       87626    87623       -3     
  Branches    24263    24263              
==========================================
+ Hits        47324    47343      +19     
+ Misses      38802    38780      -22     
  Partials     1500     1500              
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from d37da53
ai-integrations 70.03% <ø> (ø) Carriedforward from d37da53
app-defaults 69.60% <ø> (ø) Carriedforward from d37da53
augment 46.39% <ø> (ø) Carriedforward from d37da53
bulk-import 72.86% <ø> (ø) Carriedforward from d37da53
cost-management 17.48% <ø> (ø) Carriedforward from d37da53
dcm 59.65% <ø> (ø) Carriedforward from d37da53
extensions 62.25% <ø> (ø) Carriedforward from d37da53
global-floating-action-button 74.30% <ø> (ø) Carriedforward from d37da53
global-header 61.63% <ø> (ø) Carriedforward from d37da53
homepage 51.52% <ø> (ø) Carriedforward from d37da53
install-dynamic-plugins 56.23% <ø> (ø) Carriedforward from d37da53
konflux 91.01% <ø> (ø) Carriedforward from d37da53
lightspeed 68.52% <ø> (ø) Carriedforward from d37da53
mcp-integrations 85.46% <ø> (ø) Carriedforward from d37da53
orchestrator 37.33% <ø> (ø) Carriedforward from d37da53
quickstart 62.09% <ø> (ø) Carriedforward from d37da53
sandbox 79.56% <ø> (ø) Carriedforward from d37da53
scorecard 84.51% <ø> (+0.65%) ⬆️
theme 64.54% <ø> (ø) Carriedforward from d37da53
translations 8.49% <ø> (ø) Carriedforward from d37da53
x2a 78.79% <ø> (ø) Carriedforward from d37da53

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d37da53...ee951e0. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Low

  • [test-integrity] workspaces/scorecard/plugins/scorecard-backend/src/plugin.integration.test.ts:65 — The afterAll hook calls server.close() without awaiting or handling its callback. http.Server.close() does not return a promise, so connections may still be draining when Jest proceeds. This can cause "open handle" warnings or flaky teardown. The same pattern appears at line 155. Note: other test files in this repo using startTestBackend do not call server.close() at all, so the risk is minimal in this context.

  • [test-adequacy] workspaces/scorecard/plugins/scorecard-backend/src/plugin.integration.test.ts:139 — The KPI config test defines type: 'statusGrouped' and asserts aggregationType: 'statusGrouped', but this is also the default value (see mappers.ts:55 and AggregationService.ts:66). The assertion passes regardless of whether the config-driven path or the fallback is taken. Testing with a non-default type (e.g., 'average') would provide stronger assurance that config values flow through correctly. Not a bug — a coverage gap.

Info

  • [sub-agent-failure] The style-conventions sub-agent did not return findings: model claude-sonnet-4-5@20250929 not available on deployment.

  • [sub-agent-failure] The intent-coherence sub-agent did not return findings: model claude-sonnet-4-5@20250929 not available on deployment.

const BASE_CONFIG = {
backend: {
database: {
client: 'better-sqlite3',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] test-integrity

The afterAll hook calls server.close() without awaiting or handling its callback. http.Server.close() does not return a promise, so connections may still be draining when Jest proceeds. This can cause open handle warnings or flaky teardown. The same pattern appears at line 155.

'/api/scorecard/metrics?metricIds=sonar.quality&datasource=github',
);

expect(res.status).toBe(400);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] test-adequacy

The KPI config test defines type statusGrouped and asserts aggregationType statusGrouped, but this is also the default value. The assertion passes regardless of whether the config-driven path or the fallback is taken. Testing with a non-default type would provide stronger assurance.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Jun 16, 2026
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.

1 participant