You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/09/05 03:19:55 UTC
[PR] test(alert): deepen AlertRuleDuration parse coverage [rocketmq-dashboard]
yyqdbngt opened a new pull request, #3261:
URL: https://github.com/apache/rocketmq-dashboard/pull/3261
## Summary
Extends the existing `AlertRuleDurationTest` from two assertions to full parser coverage.
Added cases:
- every supported unit: `ms`, `s`, `m`, `h`, `d`, `w` (7 days), `y` (365 days);
- blank strings and `0s` parse to `Duration.ZERO`;
- compound durations across units (`2d12h`, `1w2d3h`, `1m30s500ms`);
- outer whitespace is trimmed before parsing;
- malformed inputs (`5`, `h30m`, `1h 30m`, `1h30`, `1.5h`, `5x`, `-5m`) are rejected with the `Invalid alert duration` business error.
## Why
The parser gates alert-rule request payloads; the previous suite only covered a single compound value, null, and overflow, leaving unit/grammar handling unpinned.
## Testing
`mvn -B test -Dtest=AlertRuleDurationTest` — 7/7 pass; checkstyle (validate) clean.
--
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(alert): deepen AlertRuleDuration parse coverage [rocketmq-dashboard]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed pull request #3261: test(alert): deepen AlertRuleDuration parse coverage
URL: https://github.com/apache/rocketmq-dashboard/pull/3261
--
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