Skip to content

Conversation

sonalgaud12
Copy link
Contributor

This PR fixes #6821

  • Added test for prometheusReader function for both v0.3.0 & v0.2.0

  • Locally tested

@sonalgaud12 sonalgaud12 requested review from a team and pellared as code owners June 7, 2025 15:16
Copy link

codecov bot commented Jun 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.8%. Comparing base (74313f7) to head (e2b9652).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7440   +/-   ##
=====================================
  Coverage   78.7%   78.8%           
=====================================
  Files        186     186           
  Lines      14694   14701    +7     
=====================================
+ Hits       11571   11587   +16     
+ Misses      2782    2775    -7     
+ Partials     341     339    -2     

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmathieu dmathieu added the Skip Changelog Allow PR to succeed without requiring an addition to the CHANGELOG label Jun 10, 2025
@sonalgaud12 sonalgaud12 requested a review from pellared June 11, 2025 04:54
@github-actions github-actions bot requested a review from codeboten July 7, 2025 07:14
@pellared
Copy link
Member

@sonalgaud12, are you able to address the comments?

@pellared pellared requested a review from MrAlias August 4, 2025 12:54
Co-authored-by: Tyler Yahn <[email protected]>
@sonalgaud12 sonalgaud12 requested a review from MrAlias August 6, 2025 15:26
// localhost resolves to 127.0.0.1, so we expect the resolved IP
assert.Contains(t, addr, "127.0.0.1")

resp, err := http.DefaultClient.Get("http://" + addr + "/metrics")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resp, err := http.DefaultClient.Get("http://" + addr + "/metrics")
resp, err := http.Get("http://" + addr + "/metrics")

nit, as some of your tests use http.Get

}
}

func TestPrometheusReaderErrorCases(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use a table-driven approach? Just like the other TestPrometheusReaderErrorCases method you wrote?

@pellared
Copy link
Member

@sonalgaud12, are you able to address @XSAM's comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog Allow PR to succeed without requiring an addition to the CHANGELOG

Projects

None yet

Development

Successfully merging this pull request may close these issues.

otelconf: Increase test coverage for Prometheus-related code

5 participants