RunIntegrationTests sets up Tempo for integration tests as requested through the config and then calls the provided testFunc
(t *testing.T, config TestHarnessConfig, testFunc func(*TempoHarness))
| 168 | |
| 169 | // RunIntegrationTests sets up Tempo for integration tests as requested through the config and then calls the provided testFunc |
| 170 | func RunIntegrationTests(t *testing.T, config TestHarnessConfig, testFunc func(*TempoHarness)) { |
| 171 | t.Helper() |
| 172 | t.Parallel() |
| 173 | |
| 174 | // defaults |
| 175 | if config.Backends == 0 { |
| 176 | config.Backends = BackendLocal |
| 177 | } |
| 178 | |
| 179 | if config.DeploymentMode == 0 { |
| 180 | config.DeploymentMode = DeploymentModeMicroservices |
| 181 | } |
| 182 | |
| 183 | if config.Components == 0 { |
| 184 | config.Components = ComponentsRecentDataQuerying |
| 185 | } |
| 186 | |
| 187 | backendTCs := backendTestCases(config.Backends) |
| 188 | |
| 189 | // Run tests for each deployment mode and backend combination |
| 190 | for _, be := range backendTCs { |
| 191 | // t.Run() with t.Parallel() here will cause some tests to run faster, but others like TestKVStores will fail for unknown reasons. |
| 192 | runTempoHarness(t, config, be.name, testFunc) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | type backendTestCase struct { |
| 197 | mask BackendsMask |