apache / apache/rocketmq-dashboard

[studio] CI never runs frontend unit tests (vitest)

Open Beginner friendly
#4,139 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 `frontend-build` job in `.github/workflows/ci.yml` runs `npm ci` followed by `npm run build` but **never runs `npm run test`** (vitest). This means the repo's roughly 936 frontend unit tests do not gate any PR or push to `rocketmq-studio`.

A test suite that is not enforced by CI provides no regression protection - a breaking change can be merged without any test failure.

## Current state

```yaml
frontend-build:
name: Frontend Build (Node 20)
steps:
- run: npm ci
- run: npm run build # only type-checks and bundles
```

The `test` script is defined in `web/package.json`:

```json
"test": "vitest run"
```

## Proposed change

Add a `npm run test` step to the `frontend-build` job, after install and before (or after) the build step:

```yaml
- name: Run frontend tests
run: npm run test
```

This is a one-line addition. It depends on #4136 (CI startup fix) being merged first, otherwise the workflow still fails at startup and no jobs run at all.

## Impact

- Every PR that touches frontend code will have its unit tests enforced.
- Flaky tests (maintainer noted two are already flaky) may need attention, but that is a separate issue - ignoring tests entirely is worse.
- The CI runtime will increase by the vitest execution time.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the frontend-build job in .github/workflows/ci.yml and confirm the test script in web/package.json. Run the frontend checks locally, then verify the workflow executes npm run test before or after the build and that the Vitest suite gates the job.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
ci-cd, testing
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.