apache / apache/rocketmq-dashboard

Add regression coverage for partial cluster component counting

Open Beginner friendly
#4,018 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.4k
Forks
683
Avg merge
2d 14h
Merged PRs (30d)
58

Description

## Problem
The current test suite does not cover partial cluster component counting.

## Expected behavior
- A focused Vitest case locks the existing behavior.
- The targeted test file passes and fails if the covered behavior regresses.

## Scope
Only add regression coverage for $(@{Slug=cluster-component-count; Focus=partial cluster component counting; PrTitle=test(cluster): cover partial cluster component counting; TestFile=web/src/pages/cluster/clusterStats.test.ts; Mode=existing; Append=describe('countClusterComponents partial inventories', () => {
it('counts only the component kinds present on a cluster', () => {
const clusters = [
{
...baseCluster,
brokers: [],
proxies: [{ addr: 'p:8081' } as ClusterInfo['proxies'][number]],
nameServers: [],
},
];

expect(countClusterComponents(clusters)).toEqual({
brokers: 0,
nameServers: 0,
proxies: 1,
});
});
});}.TestFile). No runtime behavior changes.

## Acceptance criteria
- [ ] The targeted Vitest file passes.
- [ ] git diff --check is clean.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with web/src/pages/cluster/clusterStats.test.ts and inspect the existing countClusterComponents tests and fixtures. Run the targeted Vitest file, add the specified regression coverage for a cluster with only proxies, and confirm the expected counts, the test passes, and git diff --check is clean.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, testing
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.