Skip to content

Commit

Permalink
Lint Fixes
Browse files Browse the repository at this point in the history
Signed-off-by: joeyyy09 <[email protected]>
  • Loading branch information
joeyyy09 committed Aug 11, 2024
1 parent b70ff9d commit 5a45dca
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions cmd/jaeger/internal/integration/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ import (
)

func modifyConfigEncoding(t *testing.T, configFile string, encoding string) string {
data, err := os.ReadFile(configFile)
require.NoError(t, err)
var config map[string]interface{}
err = yaml.Unmarshal(data, &config)
require.NoError(t, err)
exporters := config["exporters"].(map[string]interface{})
kafka := exporters["kafka"].(map[string]interface{})
kafka["encoding"] = encoding
newData, err := yaml.Marshal(config)
require.NoError(t, err)
tempFile := filepath.Join(t.TempDir(), "modified_config.yaml")
err = os.WriteFile(tempFile, newData, 0600)
require.NoError(t, err)
return tempFile
data, err := os.ReadFile(configFile)
require.NoError(t, err)

var config map[string]interface{}
err = yaml.Unmarshal(data, &config)
require.NoError(t, err)

exporters := config["exporters"].(map[string]interface{})
kafka := exporters["kafka"].(map[string]interface{})
kafka["encoding"] = encoding

newData, err := yaml.Marshal(config)
require.NoError(t, err)

tempFile := filepath.Join(t.TempDir(), "modified_config.yaml")
err = os.WriteFile(tempFile, newData, 0o600)
require.NoError(t, err)

return tempFile
}

func TestKafkaStorage(t *testing.T) {
Expand Down Expand Up @@ -80,7 +80,7 @@ func TestKafkaStorage(t *testing.T) {
// Test legacy Jaeger formats
t.Run("LegacyJaegerFormats", func(t *testing.T) {
legacyCollectorConfig := modifyConfigEncoding(t, baseCollectorConfig, "jaeger_json")
legacyIngesterConfig := modifyConfigEncoding(t, baseIngesterConfig, "jaeger_json")
legacyIngesterConfig := modifyConfigEncoding(t, baseIngesterConfig, "jaeger_json")
collector := &E2EStorageIntegration{
SkipStorageCleaner: true,
ConfigFile: legacyCollectorConfig,
Expand Down

0 comments on commit 5a45dca

Please sign in to comment.