You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Frun1na (via GitHub)" <gi...@apache.org> on 2026/09/21 12:57:01 UTC

[I] [Bug] Web API test fixtures and mocks use values the backend never sends [rocketmq-dashboard]

Frun1na opened a new issue, #4763:
URL: https://github.com/apache/rocketmq-dashboard/issues/4763

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open issues](https://github.com/apache/rocketmq-dashboard/issues) and found no similar issue.
   
   ### What Happened
   
   Several api-layer test fixtures and mock datasets feed values into the test suite that the backend
   never sends. The suite stays green while asserting against a contract that does not exist, which is
   exactly how two recent real regressions stayed invisible for weeks (#4732: the consumer page
   rendered raw filter-mode codes; #4741: protocol tags lost their color — both were covered by tests
   whose mocks used the old values).
   
   Examples (full list in the linked PR):
   
   | file | fixture value | backend value |
   |------|----------------|---------------|
   | `api/liteTopic.test.ts` | session `status: 'active'`, `ttlStatus: 'active'` | `ACTIVE` / `EXPIRED`; `UNKNOWN / EXPIRED / EXPIRING_SOON / ACTIVE` |
   | `api/dlq.test.ts`, `mock/dlq.ts` | group `status: 'active' \| 'empty'` | `ACTIVE / EMPTY / UNAVAILABLE` |
   | `api/producer.test.ts` | `language: 'JAVA'` | `ClientLanguage.name()` → `Java` |
   | `api/message.test.ts` | `deliveryStatus: 'SUCCESS'` | `success / failed / pending` |
   | `api/ops.test.ts` | `level: 'critical'` | `error / warning / info` |
   | `mock/consumers.ts` | `filterMode: 'Tag 过滤' \| 'SQL92 过滤' \| '全量'` | `TAG / SQL / CLASS_FILTER` |
   
   ### Expected Behavior
   
   Test fixtures and mock datasets use the values the API actually returns, so a contract regression
   turns the suite red instead of hiding behind stale mocks.
   
   ### Steps to Reproduce
   
   Inspect the fixtures listed above against the corresponding providers / enums
   (`RocketMQLiteTopicProvider`, `RocketMQDLQProvider`, `ProducerConnectionService`, `DeliveryStatus`,
   `AlertLevel`, `SubscriptionFilterModes`).
   
   ### Environment
   
   - RocketMQ Studio `rocketmq-studio` @ `cd448e17`
   - `web/src/api/*.test.ts`, `web/src/mock/*.ts`
   
   ### Are You Willing to Submit a Pull Request?
   
   Yes — #4762 fixes this.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Web API test fixtures and mocks use values the backend never sends [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4763:
URL: https://github.com/apache/rocketmq-dashboard/issues/4763#issuecomment-5760911985

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase.
   
   **Root Cause:** Test fixtures and mock datasets in `api/*.test.ts` and `mock/*.ts` use hardcoded values (e.g. `status: 'active'`, `language: 'JAVA'`, `deliveryStatus: 'SUCCESS'`, `level: 'critical'`) that do not match the actual enum/provider values returned by the backend (`ACTIVE`, `Java`, `success`, `error`). This means the test suite validates against a phantom contract — real regressions like #4732 and #4741 went undetected for weeks because the mocks masked the mismatch.
   
   **Impact:** Test suite provides false confidence; any frontend contract regression that changes enum values will not be caught by the existing tests.
   
   **Severity:** Medium — no production code is affected, but the test safety net is compromised.
   
   **Verification:** PR #4762 from the same author addresses this by aligning all fixtures to the real backend values. The fix is test-only (no production code changes), and all 75 tests pass with the corrected values.
   
   An automated fix proposal is not needed — the author has already submitted PR #4762 with the fix. Maintainers may proceed with reviewing that PR directly.
   
   ---
   *Automated evaluation by github-manager-bot*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Web API test fixtures and mocks use values the backend never sends [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #4763: [Bug] Web API test fixtures and mocks use values the backend never sends
URL: https://github.com/apache/rocketmq-dashboard/issues/4763


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Web API test fixtures and mocks use values the backend never sends [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #4763:
URL: https://github.com/apache/rocketmq-dashboard/issues/4763#issuecomment-5881205922

   This issue has been automatically closed because there has been no activity for 7 days. If you believe this issue is still relevant, please reopen it with updated information.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org