(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func TestDataSourceConfigure(t *testing.T) { |
| 89 | ctx := t.Context() |
| 90 | |
| 91 | appendMockSource(t) |
| 92 | |
| 93 | tests := []struct { |
| 94 | TestName string |
| 95 | String string |
| 96 | ExpectedError string |
| 97 | }{ |
| 98 | { |
| 99 | TestName: "basic_valid_config", |
| 100 | String: ` |
| 101 | mode: cat |
| 102 | labels: |
| 103 | test: foobar |
| 104 | log_level: info |
| 105 | source: mock |
| 106 | toto: test_value1 |
| 107 | `, |
| 108 | }, |
| 109 | { |
| 110 | TestName: "basic_debug_config", |
| 111 | String: ` |
| 112 | mode: cat |
| 113 | labels: |
| 114 | test: foobar |
| 115 | log_level: debug |
| 116 | source: mock |
| 117 | toto: test_value1 |
| 118 | `, |
| 119 | }, |
| 120 | { |
| 121 | TestName: "basic_tailmode_config", |
| 122 | String: ` |
| 123 | mode: tail |
| 124 | labels: |
| 125 | test: foobar |
| 126 | log_level: debug |
| 127 | source: mock |
| 128 | toto: test_value1 |
| 129 | `, |
| 130 | }, |
| 131 | { |
| 132 | TestName: "bad_mode_config", |
| 133 | String: ` |
| 134 | mode: ratata |
| 135 | labels: |
| 136 | test: foobar |
| 137 | log_level: debug |
| 138 | source: mock |
| 139 | toto: test_value1 |
| 140 | `, |
| 141 | ExpectedError: "mode ratata is not supported", |
| 142 | }, |
| 143 | { |
| 144 | TestName: "bad_type_config", |
| 145 | String: ` |
nothing calls this directly
no test coverage detected
searching dependent graphs…