use pointers for payload

This commit is contained in:
Shreyas Goenka 2024-12-24 13:32:27 +05:30
parent 151df1c2c9
commit ff15ced067
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
3 changed files with 6 additions and 6 deletions

View File

@ -43,7 +43,7 @@ func TestTelemetryLogger(t *testing.T) {
// Log some events.
err := telemetry.Log(ctx, telemetry.FrontendLogEntry{
DatabricksCliLog: telemetry.DatabricksCliLog{
CliTestEvent: events.CliTestEvent{
CliTestEvent: &events.CliTestEvent{
Name: events.DummyCliEnumValue1,
},
},
@ -51,7 +51,7 @@ func TestTelemetryLogger(t *testing.T) {
require.NoError(t, err)
err = telemetry.Log(ctx, telemetry.FrontendLogEntry{
DatabricksCliLog: telemetry.DatabricksCliLog{
CliTestEvent: events.CliTestEvent{
CliTestEvent: &events.CliTestEvent{
Name: events.DummyCliEnumValue2,
},
},

View File

@ -17,6 +17,6 @@ type FrontendLogEntry struct {
}
type DatabricksCliLog struct {
CliTestEvent events.CliTestEvent `json:"cli_test_event,omitempty"`
BundleInitEvent events.BundleInitEvent `json:"bundle_init_event,omitempty"`
CliTestEvent *events.CliTestEvent `json:"cli_test_event,omitempty"`
BundleInitEvent *events.BundleInitEvent `json:"bundle_init_event,omitempty"`
}

View File

@ -69,7 +69,7 @@ func TestTelemetryLoggerFlushesEvents(t *testing.T) {
for _, v := range []events.DummyCliEnum{events.DummyCliEnumValue1, events.DummyCliEnumValue2, events.DummyCliEnumValue2, events.DummyCliEnumValue3} {
err := Log(ctx, FrontendLogEntry{DatabricksCliLog: DatabricksCliLog{
CliTestEvent: events.CliTestEvent{Name: v},
CliTestEvent: &events.CliTestEvent{Name: v},
}})
require.NoError(t, err)
}
@ -103,7 +103,7 @@ func TestTelemetryLoggerFlushExitsOnTimeout(t *testing.T) {
for _, v := range []events.DummyCliEnum{events.DummyCliEnumValue1, events.DummyCliEnumValue2, events.DummyCliEnumValue2, events.DummyCliEnumValue3} {
err := Log(ctx, FrontendLogEntry{DatabricksCliLog: DatabricksCliLog{
CliTestEvent: events.CliTestEvent{Name: v},
CliTestEvent: &events.CliTestEvent{Name: v},
}})
require.NoError(t, err)
}