davsclaus opened a new pull request, #27974: URL: https://github.com/apache/camel/pull/27974
Ninth batch of [CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) (test coverage of the CLI commands): `camel get route` (65% line coverage before), `camel get processor` (59%), `camel get metric` (58%) and `camel get health` (60%). Their tests covered a plain table and JSON; the options and the processors, metric types and health details were not tested. ### Tests The four test classes are rewritten: each command is parsed by picocli with its real defaults, and the status files are what the route, micrometer and health dev consoles write (typed statistics, the processors of the routes, the metrics by type, the health details as text). - `CamelRouteStatusTest`: the statistics and JSON numbers, `--error` (table, stack trace, JSON), `--filter` by route id or endpoint, `--filter-mean`, `--group`/`--show-group`, `--running`, `--short-uri`, `--wide-uri`, `--source`, `--description`/`--note`, the `REMOTE` column, `--sort=name`, `--limit`. - `CamelProcessorStatusTest`: the processors as a tree under their route (node prefix, level), JSON, disabled processors, `--limit` as a number of routes, `--filter`, `--filter-mean`, `--group`, `--running`, `--source` with the code line, `--description`. - `ListMetricTest`: counters, timers, gauges and distribution summaries, JSON, `--all`, `--filter`, `--custom`, `--tags`, the `app.info` gauge. - `ListHealthTest`: state, rate and since, JSON, `--level`, `--down`, `--live`/`--ready` by the kind of the check, `--trace` (details and stack trace), `--depth`, `--trace --json`. ### Bugs the tests found - **`camel get metric`** skipped an integration that has a distribution summary, with a warning: it read the count of the summary from `value`, which the micrometer dev console does not have (it is `count`). - **`camel get metric --filter=timer*`**, the example in its help, showed nothing: the filter was a plain text. It takes a pattern now (and still a part of the name or tags). **`--custom`** left out the metrics of Camel in the classic naming (`CamelExchangesTotal`) only, not in the default naming of Micrometer (`camel.exchanges.total`). - **`camel get route --error --limit`** limited the routes before picking the ones with an error, so it could show none. **`--note`** did not show the notes in the table of `--error`. - **`camel get processor --filter`** showed the matching processors without their route, and so without the name and pid of their integration (the processor rows leave those columns empty). **`--filter-mean`** left out the faster routes but not the faster processors, while its description is "Filter processors that must be slower than the given time". - **`camel get health --level`** with a value other than `full` or `default` was taken as `full`; now a usage error (`2`), as for the other options with a fixed set of values. The user-visible changes are in the 4.24 upgrade guide, and the managing page says what `camel get metric --filter`, `--custom` and `--all` do. ### Not changed, for a decision `camel get processor --remote` has no effect: it reads remote counters from the statistics of the routes, but the route dev console has never had them (only the context dev console has, for `camel get context`). Either the route console reports them, or the option goes. `mvn test` of camel-jbang-core: all tests pass. Each fix was checked by running the new tests without it: the 9 tests of the bugs fail. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
