Note: Standard wal block functionality (appending, searching, finding, etc.) is tested with all other wal blocks in /tempodb/wal/wal_test.go
(t *testing.T)
| 27 | // in /tempodb/wal/wal_test.go |
| 28 | |
| 29 | func TestFullFilename(t *testing.T) { |
| 30 | tests := []struct { |
| 31 | name string |
| 32 | b *walBlock |
| 33 | expected string |
| 34 | }{ |
| 35 | { |
| 36 | name: "basic", |
| 37 | b: &walBlock{ |
| 38 | meta: backend.NewBlockMeta("foo", uuid.MustParse("123e4567-e89b-12d3-a456-426614174000"), VersionString), |
| 39 | path: "/blerg", |
| 40 | }, |
| 41 | expected: "/blerg/123e4567-e89b-12d3-a456-426614174000+foo+" + VersionString, |
| 42 | }, |
| 43 | { |
| 44 | name: "no path", |
| 45 | b: &walBlock{ |
| 46 | meta: backend.NewBlockMeta("foo", uuid.MustParse("123e4567-e89b-12d3-a456-426614174000"), VersionString), |
| 47 | path: "", |
| 48 | }, |
| 49 | expected: "123e4567-e89b-12d3-a456-426614174000+foo+" + VersionString, |
| 50 | }, |
| 51 | } |
| 52 | |
| 53 | for _, tc := range tests { |
| 54 | t.Run(tc.name, func(t *testing.T) { |
| 55 | actual := tc.b.walPath() |
| 56 | assert.Equal(t, tc.expected, actual) |
| 57 | }) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // TestPartialReplay verifies that we can best-effort replay a partial/corrupted WAL block. |
| 62 | // This test works by flushing a WAL block across a few pages, corrupting one, and then replaying |
nothing calls this directly
no test coverage detected