|
24 | 24 | import org.elasticsearch.test.rest.TestFeatureService; |
25 | 25 | import org.elasticsearch.xpack.esql.CsvSpecReader; |
26 | 26 | import org.elasticsearch.xpack.esql.CsvSpecReader.CsvTestCase; |
| 27 | +import org.elasticsearch.xpack.esql.CsvTestsDataLoader; |
27 | 28 | import org.elasticsearch.xpack.esql.SpecReader; |
28 | 29 | import org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase; |
29 | 30 | import org.junit.AfterClass; |
|
45 | 46 |
|
46 | 47 | import static org.elasticsearch.xpack.esql.CsvSpecReader.specParser; |
47 | 48 | import static org.elasticsearch.xpack.esql.CsvTestUtils.isEnabled; |
| 49 | +import static org.elasticsearch.xpack.esql.CsvTestsDataLoader.CSV_DATASET_MAP; |
48 | 50 | import static org.elasticsearch.xpack.esql.CsvTestsDataLoader.ENRICH_SOURCE_INDICES; |
49 | 51 | import static org.elasticsearch.xpack.esql.EsqlTestUtils.classpathResources; |
50 | 52 | import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.FORK_V9; |
@@ -210,20 +212,11 @@ protected RestClient buildClient(Settings settings, HttpHost[] localHosts) throw |
210 | 212 | public static final List<String> METADATA_INDICES = List.of("employees", "apps", "ul_logs"); |
211 | 213 |
|
212 | 214 | // These are lookup indices, we want them on both remotes and locals |
213 | | - // TODO: can we somehow find it from the data loader? |
214 | | - public static final Set<String> LOOKUP_INDICES = Set.of( |
215 | | - "languages_nested_fields", |
216 | | - "languages_lookup", |
217 | | - "clientips_lookup", |
218 | | - "languages_mixed_numerics", |
219 | | - "threat_list", |
220 | | - "message_types_lookup", |
221 | | - "host_inventory", |
222 | | - "ownerships", |
223 | | - "languages_lookup_non_unique_key", |
224 | | - "lookup_sample_data_ts_nanos", |
225 | | - "service_owners" |
226 | | - ); |
| 215 | + public static final Set<String> LOOKUP_INDICES = CSV_DATASET_MAP.values() |
| 216 | + .stream() |
| 217 | + .filter(td -> td.settingFileName().equals("lookup-settings.json")) |
| 218 | + .map(CsvTestsDataLoader.TestDataset::indexName) |
| 219 | + .collect(Collectors.toSet()); |
227 | 220 |
|
228 | 221 | public static final Set<String> LOOKUP_ENDPOINTS = LOOKUP_INDICES.stream().map(i -> "/" + i + "/_bulk").collect(Collectors.toSet()); |
229 | 222 |
|
|
0 commit comments