You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "btlqql (via GitHub)" <gi...@apache.org> on 2026/09/07 02:06:07 UTC
[PR] test(csv-import): cover resource name validation [rocketmq-dashboard]
btlqql opened a new pull request, #4017:
URL: https://github.com/apache/rocketmq-dashboard/pull/4017
## Summary
Add a focused Vitest regression case for resource name validation in CSV import.
## Root cause
The current test suite does not cover resource name validation in CSV import, so the behavior could regress without a failing test.
## Changes
- Add regression coverage in $(@{Slug=csv-resource-name; Focus=resource name validation in CSV import; PrTitle=test(csv-import): cover resource name validation; TestFile=web/src/utils/resourceCsvImport.test.ts; Mode=existing; Append=describe('validateResourceName', () => {
it('accepts supported topic and group names and reports unsupported characters', () => {
expect(validateResourceName('orders-topic_%|1', 'topic')).toBeNull();
expect(validateResourceName('cg_orders', 'group')).toBeNull();
expect(validateResourceName('bad name', 'topic')).toBe('Name 仅支持字母、数字、下划线、短横线、% 和 |');
});
it('rejects empty names and names beyond the per-resource length limit', () => {
expect(validateResourceName('', 'topic')).toBe('Name 不能为空');
expect(validateResourceName('a'.repeat(128), 'topic')).toBe('Name 长度不能超过 127 个字符');
expect(validateResourceName('a'.repeat(121), 'group')).toBe('Name 长度不能超过 120 个字符');
});
});}.TestFile).
## Testing
Commands run:
- cd web
-
px vitest run src/utils/resourceCsvImport.test.ts
- cd ..
- git diff --check
Actual results:
- Vitest: $testFilesLine, $testsLine.
- git diff --check: no output, exit code 0.
I did not run the full Maven/Java server suite on this Windows host because Maven is not installed and the server targets Java 21 while only Java 17 is available. This PR changes web test code only.
Fixes #4016
Assisted-by: OpenAI:Codex (GPT-5)
Percentage of AI-generated code: 100
--
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: [PR] test(csv-import): cover resource name validation [rocketmq-dashboard]
Posted by "btlqql (via GitHub)" <gi...@apache.org>.
btlqql closed pull request #4017: test(csv-import): cover resource name validation
URL: https://github.com/apache/rocketmq-dashboard/pull/4017
--
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