opentelemetry-collector
opentelemetry-collector copied to clipboard
[confighttp] newDefault for confighttp package structs
Description:
NewDefault methods to all the exported structs in confighttp package
Link to tracking Issue: closes #9655
Testing: Added test for the same.
Documentation: godoc
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.56%. Comparing base (
31528ce) to head (89d1c0d). Report is 152 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9672 +/- ##
=======================================
Coverage 91.56% 91.56%
=======================================
Files 360 360
Lines 16698 16704 +6
=======================================
+ Hits 15289 15295 +6
Misses 1073 1073
Partials 336 336
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
why are contrib-tests failing? : |
@astencel-sumo some contrib tests are failing in github actions, but I did ran all tests on local but nothing failed there, I also looked into the failing test it is expecting nil value for our map.
ClientConfigandServerConfigdepend onconfigtls. I think we should wait on this PR until theNewDefaultfunctions exist forconfigtls.
I don't think that's the problem. The reason the contrib tests are failing is that I asked Sanket to make the NewDefaultClientConfig and NewDefaultServerConfig to initialize the Headers and ResponseHeaders maps to empty maps. Previously those where nil. The tests in contrib expect those properties to be nil.
See e.g. here: https://github.com/open-telemetry/opentelemetry-collector/actions/runs/8231961010/job/22508354464?pr=9672#step:4:1109
=== FAIL: . TestLoadConfig/zipkin/2 (0.00s)
config_test.go:86:
Error Trace: /tmp/opentelemetry-collector-contrib/exporter/zipkinexporter/config_test.go:86
Diff:
--- Expected
+++ Actual
@@ -39,3 +39,4 @@
Timeout: (time.Duration) 5000000000,
- Headers: (map[string]configopaque.String) <nil>,
+ Headers: (map[string]configopaque.String) {
+ },
I'm not exactly sure what's the preferred course of action here.
- Allow contrib tests to fail and fix them after updating core in contrib?
- Fix those tests before merging this change so that those tests to not check that
ResponseandResponseHeadersarenil? - ...?
What's your opinion @TylerHelmuth ?
Oh my comment was only a general statement, not a reason for the failing tests. I dont think we should introduce NewDefault* functions here until they can depend on the NewDefault* functions from configtls.
For the tests themselves I'd say we have 2 options:
- Not use empty map as the default value and instead use nil
- Allow contrib tests to fail and fix them after updating core in contrib
Oh my comment was only a general statement, not a reason for the failing tests. I dont think we should introduce
NewDefault*functions here until they can depend on theNewDefault*functions fromconfigtls.
Oh, I see :smile: Makes sense, @Sanket-0510 this means this PR should wait for https://github.com/open-telemetry/opentelemetry-collector/pull/9658. After https://github.com/open-telemetry/opentelemetry-collector/pull/9658 is merged, you can incorporate changes from main (by merging or rebasing) and then we can continue with this.
For the tests themselves I'd say we have 2 options:
1. Not use empty map as the default value and instead use nil 2. Allow contrib tests to fail and fix them after updating core in contrib
I don't like 1, I believe the functions should not leave the map as nil, as this would expose users of those functions to potential panic. Let's go with 2 if possible.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
@Sanket-0510 this is ready to use the configtls. NewDefault* funcs
@Sanket-0510 this is ready to use the
configtls. NewDefault*funcs
I'll rebase!
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
Closed as inactive. Feel free to reopen if this PR is still being worked on.