(t *testing.T)
| 33 | ) |
| 34 | |
| 35 | func TestExtractOtelFromContext(t *testing.T) { |
| 36 | if testing.Short() { |
| 37 | t.Skip("Requires filesystem access") |
| 38 | } |
| 39 | |
| 40 | dir := t.TempDir() |
| 41 | |
| 42 | st := store.New(dir, testStoreCfg) |
| 43 | err := st.CreateOrUpdate(store.Metadata{ |
| 44 | Name: "test", |
| 45 | Metadata: command.DockerContext{ |
| 46 | Description: t.Name(), |
| 47 | AdditionalFields: map[string]any{ |
| 48 | "otel": map[string]any{ |
| 49 | "OTEL_EXPORTER_OTLP_ENDPOINT": "localhost:1234", |
| 50 | }, |
| 51 | }, |
| 52 | }, |
| 53 | Endpoints: make(map[string]any), |
| 54 | }) |
| 55 | assert.NilError(t, err) |
| 56 | |
| 57 | cfg, err := tracing.ConfigFromDockerContext(st, "test") |
| 58 | assert.NilError(t, err) |
| 59 | assert.Equal(t, "localhost:1234", cfg.Endpoint) |
| 60 | } |
nothing calls this directly
no test coverage detected