Commit 9cf6a3b
Improve test coverage for prometheus application plugin (#166)
* Improve test coverage for prometheus application plugin
Add tests for New, Config, PromCollector methods, metricExpiry,
collectorExpiry, ReceiveMetric, UpdateMetrics, Describe, and Collect.
Omit logging and HTTP server tests.
* Fix golangci-lint empty-block error in prometheus tests
Replace empty for-range loop with explicit assignment to satisfy revive linter.
* Add timestamp verification assertions to prometheus collector tests
Enhance test coverage by adding assertions that verify the presence or
absence of timestamps in collected metrics. The "collect with timestamp"
test now verifies that metrics include the expected timestamp value,
while the "collect with zero timestamp" test confirms that metrics with
zero timestamps are sent without timestamp metadata.
Also fixes default port assertion and cleans up empty-block lint issue.
* Fix golangci-lint empty-block error in channel drain loop
Replace empty for-range loop with explicit variable usage to resolve
the revive empty-block linting error.
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent a396a96 commit 9cf6a3b
1 file changed
Lines changed: 695 additions & 0 deletions
0 commit comments