MCPcopy
hub / github.com/uber/aresdb / TestSchemaMutator

Function TestSchemaMutator

controller/mutators/etcd/schema_mutator_test.go:28–260  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestSchemaMutator(t *testing.T) {
29
30 defaultConfig := metaCom.TableConfig{
31 BatchSize: metastore.DefaultBatchSize,
32 ArchivingIntervalMinutes: metastore.DefaultArchivingIntervalMinutes,
33 ArchivingDelayMinutes: metastore.DefaultArchivingDelayMinutes,
34 BackfillMaxBufferSize: metastore.DefaultBackfillMaxBufferSize,
35 BackfillIntervalMinutes: metastore.DefaultBackfillIntervalMinutes,
36 BackfillThresholdInBytes: metastore.DefaultBackfillThresholdInBytes,
37 BackfillStoreBatchSize: metastore.DefaultBackfillStoreBatchSize,
38 RecordRetentionInDays: metastore.DefaultRecordRetentionInDays,
39 SnapshotIntervalMinutes: metastore.DefaultSnapshotIntervalMinutes,
40 SnapshotThreshold: metastore.DefaultSnapshotThreshold,
41 RedoLogRotationInterval: metastore.DefaultRedologRotationInterval,
42 MaxRedoLogFileSize: metastore.DefaultMaxRedoLogSize,
43 }
44
45 testTable := metaCom.Table{
46 Version: 0,
47 Name: "test1",
48 Columns: []metaCom.Column{
49 {
50 Name: "col1",
51 Type: "Int32",
52 },
53 },
54 PrimaryKeyColumns: []int{0},
55 Config: metastore.DefaultTableConfig,
56 }
57 testTable2 := metaCom.Table{
58 Version: 0,
59 Name: "test1",
60 Columns: []metaCom.Column{
61 {
62 Name: "col1",
63 Type: "Int32",
64 },
65 {
66 Name: "col2",
67 Type: "Int32",
68 },
69 },
70 Config: metastore.DefaultTableConfig,
71 PrimaryKeyColumns: []int{0},
72 }
73 testTable2.Config.BatchSize = 100
74
75 defaultValue := "default"
76 testTable3 := metaCom.Table{
77 Version: 0,
78 Name: "test3",
79 Columns: []metaCom.Column{
80 {
81 Name: "col1",
82 Type: "SmallEnum",
83 DefaultValue: &defaultValue,
84 },
85 },

Callers

nothing calls this directly

Calls 12

ListTablesMethod · 0.95
CreateTableMethod · 0.95
GetHashMethod · 0.95
GetTableMethod · 0.95
UpdateTableMethod · 0.95
DeleteTableMethod · 0.95
GetEnumCasesMethod · 0.95
SchemaListKeyFunction · 0.92
SchemaKeyFunction · 0.92
NewEnumMutatorFunction · 0.85
RunMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected