Skip to content

Commit cf0f0da

Browse files
committed
--wip-- [skip ci]
1 parent d179324 commit cf0f0da

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

openfeature/exposure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type exposureWriter struct {
106106
}
107107

108108
// newExposureWriter creates a new exposure writer with the given configuration
109-
func newExposureWriter(config *ProviderConfig) *exposureWriter {
109+
func newExposureWriter(config ProviderConfig) *exposureWriter {
110110
flushInterval := config.ExposureFlushInterval
111111
if flushInterval == 0 {
112112
flushInterval = defaultExposureFlushInterval

openfeature/integration_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
// using the actual OpenFeature SDK client.
1919
func TestEndToEnd_BooleanFlag(t *testing.T) {
2020
// Create provider and configuration
21-
provider := newDatadogProvider(nil)
21+
provider := newDatadogProvider(ProviderConfig{})
2222
config := createE2EBooleanConfig()
2323
provider.updateConfiguration(&config)
2424

@@ -88,7 +88,7 @@ func TestEndToEnd_BooleanFlag(t *testing.T) {
8888

8989
// TestEndToEnd_StringFlag tests string flag evaluation with the OpenFeature SDK.
9090
func TestEndToEnd_StringFlag(t *testing.T) {
91-
provider := newDatadogProvider(nil)
91+
provider := newDatadogProvider(ProviderConfig{})
9292
config := createE2EStringConfig()
9393
provider.updateConfiguration(config)
9494

@@ -133,7 +133,7 @@ func TestEndToEnd_StringFlag(t *testing.T) {
133133

134134
// TestEndToEnd_IntegerFlag tests integer flag evaluation.
135135
func TestEndToEnd_IntegerFlag(t *testing.T) {
136-
provider := newDatadogProvider(nil)
136+
provider := newDatadogProvider(ProviderConfig{})
137137
config := createE2EIntegerConfig()
138138
provider.updateConfiguration(config)
139139

@@ -178,7 +178,7 @@ func TestEndToEnd_IntegerFlag(t *testing.T) {
178178

179179
// TestEndToEnd_FloatFlag tests float flag evaluation.
180180
func TestEndToEnd_FloatFlag(t *testing.T) {
181-
provider := newDatadogProvider(nil)
181+
provider := newDatadogProvider(ProviderConfig{})
182182
config := createE2EFloatConfig()
183183
provider.updateConfiguration(config)
184184

@@ -206,7 +206,7 @@ func TestEndToEnd_FloatFlag(t *testing.T) {
206206

207207
// TestEndToEnd_ObjectFlag tests JSON/object flag evaluation.
208208
func TestEndToEnd_ObjectFlag(t *testing.T) {
209-
provider := newDatadogProvider(nil)
209+
provider := newDatadogProvider(ProviderConfig{})
210210
config := createE2EObjectConfig()
211211
provider.updateConfiguration(config)
212212

@@ -252,7 +252,7 @@ func TestEndToEnd_ObjectFlag(t *testing.T) {
252252

253253
// TestEndToEnd_DisabledFlag tests that disabled flags return defaults.
254254
func TestEndToEnd_DisabledFlag(t *testing.T) {
255-
provider := newDatadogProvider(nil)
255+
provider := newDatadogProvider(ProviderConfig{})
256256
config := &universalFlagsConfiguration{
257257
Format: "SERVER",
258258
Environment: environment{
@@ -297,7 +297,7 @@ func TestEndToEnd_DisabledFlag(t *testing.T) {
297297

298298
// TestEndToEnd_MissingFlag tests error handling for non-existent flags.
299299
func TestEndToEnd_MissingFlag(t *testing.T) {
300-
provider := newDatadogProvider(nil)
300+
provider := newDatadogProvider(ProviderConfig{})
301301
config := &universalFlagsConfiguration{
302302
Format: "SERVER",
303303
Environment: environment{
@@ -334,7 +334,7 @@ func TestEndToEnd_MissingFlag(t *testing.T) {
334334

335335
// TestEndToEnd_ConfigurationUpdate tests that configuration updates are reflected in evaluations.
336336
func TestEndToEnd_ConfigurationUpdate(t *testing.T) {
337-
provider := newDatadogProvider(nil)
337+
provider := newDatadogProvider(ProviderConfig{})
338338
provider.updateConfiguration(&universalFlagsConfiguration{})
339339
err := of.SetProviderAndWait(provider)
340340
if err != nil {
@@ -368,7 +368,7 @@ func TestEndToEnd_ConfigurationUpdate(t *testing.T) {
368368

369369
// TestEndToEnd_TrafficSharding tests that traffic distribution works correctly.
370370
func TestEndToEnd_TrafficSharding(t *testing.T) {
371-
provider := newDatadogProvider(nil)
371+
provider := newDatadogProvider(ProviderConfig{})
372372
config := createE2EShardingConfig()
373373
provider.updateConfiguration(config)
374374

@@ -826,7 +826,7 @@ func TestEndToEnd_JSONSerialization(t *testing.T) {
826826
}
827827

828828
// Use the parsed config
829-
provider := newDatadogProvider(nil)
829+
provider := newDatadogProvider(ProviderConfig{})
830830
provider.updateConfiguration(&parsedConfig)
831831

832832
err = of.SetProviderAndWait(provider)
@@ -853,7 +853,7 @@ func TestEndToEnd_JSONSerialization(t *testing.T) {
853853
// TestEndToEnd_EmptyRulesAllocation tests that an allocation with no rules matches all users.
854854
// This covers the fix where empty rules should match everyone (no targeting restrictions).
855855
func TestEndToEnd_EmptyRulesAllocation(t *testing.T) {
856-
provider := newDatadogProvider(nil)
856+
provider := newDatadogProvider(ProviderConfig{})
857857
config := &universalFlagsConfiguration{
858858
Format: "SERVER",
859859
Environment: environment{
@@ -925,7 +925,7 @@ func TestEndToEnd_EmptyRulesAllocation(t *testing.T) {
925925
// TestEndToEnd_ShardCalculationWithDash tests that the shard calculation uses
926926
// salt + "-" + targetingKey (with dash separator) to match Eppo SDK implementation.
927927
func TestEndToEnd_ShardCalculationWithDash(t *testing.T) {
928-
provider := newDatadogProvider(nil)
928+
provider := newDatadogProvider(ProviderConfig{})
929929
config := &universalFlagsConfiguration{
930930
Format: "SERVER",
931931
Environment: environment{
@@ -1035,7 +1035,7 @@ func TestEndToEnd_ShardCalculationWithDash(t *testing.T) {
10351035
// TestEndToEnd_IdAttributeFallback tests that when an attribute named "id" is not
10361036
// explicitly provided, the targeting key is used as the "id" value.
10371037
func TestEndToEnd_IdAttributeFallback(t *testing.T) {
1038-
provider := newDatadogProvider(nil)
1038+
provider := newDatadogProvider(ProviderConfig{})
10391039
config := &universalFlagsConfiguration{
10401040
Format: "SERVER",
10411041
Environment: environment{
@@ -1151,7 +1151,7 @@ func TestEndToEnd_IdAttributeFallback(t *testing.T) {
11511151

11521152
// TestEndToEnd_AllThreeFixes tests a complex scenario that exercises all three fixes together.
11531153
func TestEndToEnd_AllThreeFixes(t *testing.T) {
1154-
provider := newDatadogProvider(nil)
1154+
provider := newDatadogProvider(ProviderConfig{})
11551155
config := &universalFlagsConfiguration{
11561156
Format: "SERVER",
11571157
Environment: environment{

openfeature/provider_bench_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// BenchmarkBooleanEvaluation benchmarks boolean flag evaluation
1616
func BenchmarkBooleanEvaluation(b *testing.B) {
17-
provider := newDatadogProvider(nil)
17+
provider := newDatadogProvider(ProviderConfig{})
1818
config := createTestConfig()
1919
provider.updateConfiguration(config)
2020

@@ -34,7 +34,7 @@ func BenchmarkBooleanEvaluation(b *testing.B) {
3434

3535
// BenchmarkStringEvaluation benchmarks string flag evaluation
3636
func BenchmarkStringEvaluation(b *testing.B) {
37-
provider := newDatadogProvider(nil)
37+
provider := newDatadogProvider(ProviderConfig{})
3838
config := createTestConfig()
3939
provider.updateConfiguration(config)
4040

@@ -54,7 +54,7 @@ func BenchmarkStringEvaluation(b *testing.B) {
5454

5555
// BenchmarkIntEvaluation benchmarks integer flag evaluation
5656
func BenchmarkIntEvaluation(b *testing.B) {
57-
provider := newDatadogProvider(nil)
57+
provider := newDatadogProvider(ProviderConfig{})
5858
config := createTestConfig()
5959
provider.updateConfiguration(config)
6060

@@ -74,7 +74,7 @@ func BenchmarkIntEvaluation(b *testing.B) {
7474

7575
// BenchmarkFloatEvaluation benchmarks float flag evaluation
7676
func BenchmarkFloatEvaluation(b *testing.B) {
77-
provider := newDatadogProvider(nil)
77+
provider := newDatadogProvider(ProviderConfig{})
7878
config := createTestConfig()
7979
provider.updateConfiguration(config)
8080

@@ -94,7 +94,7 @@ func BenchmarkFloatEvaluation(b *testing.B) {
9494

9595
// BenchmarkObjectEvaluation benchmarks object flag evaluation
9696
func BenchmarkEvaluation(b *testing.B) {
97-
provider := newDatadogProvider(nil)
97+
provider := newDatadogProvider(ProviderConfig{})
9898
config := createTestConfig()
9999
provider.updateConfiguration(config)
100100

@@ -126,7 +126,7 @@ func BenchmarkEvaluationWithVaryingContextSize(b *testing.B) {
126126

127127
for _, size := range contextSizes {
128128
b.Run(size.name, func(b *testing.B) {
129-
provider := newDatadogProvider(nil)
129+
provider := newDatadogProvider(ProviderConfig{})
130130
config := createTestConfig()
131131
provider.updateConfiguration(config)
132132

@@ -165,7 +165,7 @@ func BenchmarkEvaluationWithVaryingFlagCounts(b *testing.B) {
165165

166166
for _, count := range flagCounts {
167167
b.Run(count.name, func(b *testing.B) {
168-
provider := newDatadogProvider(nil)
168+
provider := newDatadogProvider(ProviderConfig{})
169169
config := createTestConfig()
170170

171171
// Add additional flags
@@ -213,7 +213,7 @@ func BenchmarkEvaluationWithVaryingFlagCounts(b *testing.B) {
213213

214214
// BenchmarkConcurrentEvaluations benchmarks concurrent flag evaluations
215215
func BenchmarkConcurrentEvaluations(b *testing.B) {
216-
provider := newDatadogProvider(nil)
216+
provider := newDatadogProvider(ProviderConfig{})
217217
config := createTestConfig()
218218
provider.updateConfiguration(config)
219219

openfeature/provider_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func createTestConfig() *universalFlagsConfiguration {
243243
}
244244

245245
func TestNewDatadogProvider(t *testing.T) {
246-
provider := newDatadogProvider(nil)
246+
provider := newDatadogProvider(ProviderConfig{})
247247
if provider == nil {
248248
t.Fatal("expected provider to be non-nil")
249249
}
@@ -260,7 +260,7 @@ func TestNewDatadogProvider(t *testing.T) {
260260
}
261261

262262
func TestBooleanEvaluation(t *testing.T) {
263-
provider := newDatadogProvider(nil)
263+
provider := newDatadogProvider(ProviderConfig{})
264264
config := createTestConfig()
265265
provider.updateConfiguration(config)
266266

@@ -332,7 +332,7 @@ func TestBooleanEvaluation(t *testing.T) {
332332
}
333333

334334
func TestStringEvaluation(t *testing.T) {
335-
provider := newDatadogProvider(nil)
335+
provider := newDatadogProvider(ProviderConfig{})
336336
config := createTestConfig()
337337
provider.updateConfiguration(config)
338338

@@ -373,7 +373,7 @@ func TestStringEvaluation(t *testing.T) {
373373
}
374374

375375
func TestIntEvaluation(t *testing.T) {
376-
provider := newDatadogProvider(nil)
376+
provider := newDatadogProvider(ProviderConfig{})
377377
config := createTestConfig()
378378
provider.updateConfiguration(config)
379379

@@ -410,7 +410,7 @@ func TestIntEvaluation(t *testing.T) {
410410
}
411411

412412
func TestFloatEvaluation(t *testing.T) {
413-
provider := newDatadogProvider(nil)
413+
provider := newDatadogProvider(ProviderConfig{})
414414
config := createTestConfig()
415415
provider.updateConfiguration(config)
416416

@@ -448,7 +448,7 @@ func TestFloatEvaluation(t *testing.T) {
448448
}
449449

450450
func TestObjectEvaluation(t *testing.T) {
451-
provider := newDatadogProvider(nil)
451+
provider := newDatadogProvider(ProviderConfig{})
452452
config := createTestConfig()
453453
provider.updateConfiguration(config)
454454

@@ -498,7 +498,7 @@ func TestObjectEvaluation(t *testing.T) {
498498
}
499499

500500
func TestProviderWithoutConfiguration(t *testing.T) {
501-
provider := newDatadogProvider(nil)
501+
provider := newDatadogProvider(ProviderConfig{})
502502
ctx := context.Background()
503503

504504
flatCtx := openfeature.FlattenedContext{
@@ -521,7 +521,7 @@ func TestProviderWithoutConfiguration(t *testing.T) {
521521
}
522522

523523
func TestProviderConfigurationUpdate(t *testing.T) {
524-
provider := newDatadogProvider(nil)
524+
provider := newDatadogProvider(ProviderConfig{})
525525

526526
// Initially no config
527527
if provider.getConfiguration() != nil {
@@ -543,7 +543,7 @@ func TestProviderConfigurationUpdate(t *testing.T) {
543543
}
544544

545545
func TestConcurrentEvaluations(t *testing.T) {
546-
provider := newDatadogProvider(nil)
546+
provider := newDatadogProvider(ProviderConfig{})
547547
config := createTestConfig()
548548
provider.updateConfiguration(config)
549549

openfeature/remoteconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
ffeCapability = 46
2222
)
2323

24-
func startWithRemoteConfig(config *ProviderConfig) (*DatadogProvider, error) {
24+
func startWithRemoteConfig(config ProviderConfig) (*DatadogProvider, error) {
2525
provider := newDatadogProvider(config)
2626

2727
if err := remoteconfig.Start(remoteconfig.DefaultClientConfig()); err != nil {

openfeature/remoteconfig_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func TestValidateFlag(t *testing.T) {
413413

414414
func TestProcessConfigUpdate(t *testing.T) {
415415
t.Run("valid configuration update", func(t *testing.T) {
416-
provider := newDatadogProvider(nil)
416+
provider := newDatadogProvider(ProviderConfig{})
417417

418418
config := universalFlagsConfiguration{
419419
CreatedAt: time.Now(),
@@ -455,7 +455,7 @@ func TestProcessConfigUpdate(t *testing.T) {
455455
})
456456

457457
t.Run("configuration deletion", func(t *testing.T) {
458-
provider := newDatadogProvider(nil)
458+
provider := newDatadogProvider(ProviderConfig{})
459459

460460
// First set a configuration
461461
config := &universalFlagsConfiguration{
@@ -487,7 +487,7 @@ func TestProcessConfigUpdate(t *testing.T) {
487487
})
488488

489489
t.Run("invalid JSON", func(t *testing.T) {
490-
provider := newDatadogProvider(nil)
490+
provider := newDatadogProvider(ProviderConfig{})
491491

492492
invalidJSON := []byte("{invalid json")
493493
status := processConfigUpdate(provider, "test-path", invalidJSON)
@@ -501,7 +501,7 @@ func TestProcessConfigUpdate(t *testing.T) {
501501
})
502502

503503
t.Run("invalid configuration", func(t *testing.T) {
504-
provider := newDatadogProvider(nil)
504+
provider := newDatadogProvider(ProviderConfig{})
505505

506506
config := universalFlagsConfiguration{
507507
Format: "INVALID",
@@ -521,7 +521,7 @@ func TestProcessConfigUpdate(t *testing.T) {
521521
}
522522

523523
func TestCreateRemoteConfigCallback(t *testing.T) {
524-
provider := newDatadogProvider(nil)
524+
provider := newDatadogProvider(ProviderConfig{})
525525
callback := createRemoteConfigCallback(provider)
526526

527527
// Create a valid configuration
@@ -579,7 +579,7 @@ func TestRemoteConfigIntegration(t *testing.T) {
579579
// connect to Remote Config (would require a running agent)
580580

581581
t.Run("callback handles multiple updates", func(t *testing.T) {
582-
provider := newDatadogProvider(nil)
582+
provider := newDatadogProvider(ProviderConfig{})
583583
callback := createRemoteConfigCallback(provider)
584584

585585
// Create two different configurations
@@ -645,7 +645,7 @@ func TestRemoteConfigIntegration(t *testing.T) {
645645
})
646646

647647
t.Run("callback handles mixed success and failure", func(t *testing.T) {
648-
provider := newDatadogProvider(nil)
648+
provider := newDatadogProvider(ProviderConfig{})
649649
callback := createRemoteConfigCallback(provider)
650650

651651
validConfig := universalFlagsConfiguration{
@@ -683,7 +683,7 @@ func TestRemoteConfigIntegration(t *testing.T) {
683683
}
684684

685685
func TestConfigurationPersistence(t *testing.T) {
686-
provider := newDatadogProvider(nil)
686+
provider := newDatadogProvider(ProviderConfig{})
687687

688688
// Simulate multiple Remote Config updates
689689
callback := createRemoteConfigCallback(provider)

0 commit comments

Comments
 (0)