Skip to content

Commit d0c276c

Browse files
authored
QA: Merge query-builder-bwc to restart test (#30979)
Merges the `query-builder-bwc` qa project into the `full-cluster-restart` qa project, saving a cluster starts on every build and *many* cluster starts on `./gradlew bwcTests`.
1 parent 50e60a5 commit d0c276c

File tree

4 files changed

+41
-90
lines changed

4 files changed

+41
-90
lines changed

qa/query-builder-bwc/src/test/java/org/elasticsearch/bwc/QueryBuilderBWCIT.java renamed to qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/QueryBuilderBWCIT.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
package org.elasticsearch.bwc;
20+
package org.elasticsearch.upgrades;
2121

2222
import org.apache.http.util.EntityUtils;
2323
import org.elasticsearch.Version;
@@ -153,6 +153,21 @@ protected boolean preserveIndicesUponCompletion() {
153153
return true;
154154
}
155155

156+
@Override
157+
protected boolean preserveSnapshotsUponCompletion() {
158+
return true;
159+
}
160+
161+
@Override
162+
protected boolean preserveReposUponCompletion() {
163+
return true;
164+
}
165+
166+
@Override
167+
protected boolean preserveTemplatesUponCompletion() {
168+
return true;
169+
}
170+
156171
public void testQueryBuilderBWC() throws Exception {
157172
String index = "queries";
158173
if (runningAgainstOldCluster) {

qa/query-builder-bwc/build.gradle

Lines changed: 0 additions & 89 deletions
This file was deleted.

x-pack/qa/full-cluster-restart/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ subprojects {
184184
systemProperty 'tests.old_cluster_version', version.toString().minus("-SNAPSHOT")
185185
systemProperty 'tests.path.repo', new File(buildDir, "cluster/shared/repo")
186186
exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class'
187+
exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class'
187188
}
188189

189190
Task upgradedClusterTest = tasks.create(name: "${baseName}#upgradedClusterTest", type: RestIntegTestTask)
@@ -222,6 +223,7 @@ subprojects {
222223
systemProperty 'tests.old_cluster_version', version.toString().minus("-SNAPSHOT")
223224
systemProperty 'tests.path.repo', new File(buildDir, "cluster/shared/repo")
224225
exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class'
226+
exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class'
225227
}
226228

227229
Task versionBwcTest = tasks.create(name: "${baseName}#bwcTest") {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
package org.elasticsearch.xpack.restart;
7+
8+
import org.elasticsearch.common.settings.Settings;
9+
import org.elasticsearch.common.util.concurrent.ThreadContext;
10+
11+
import java.nio.charset.StandardCharsets;
12+
import java.util.Base64;
13+
14+
public class QueryBuilderBWCIT extends org.elasticsearch.upgrades.QueryBuilderBWCIT {
15+
16+
@Override
17+
protected Settings restClientSettings() {
18+
String token = "Basic " + Base64.getEncoder().encodeToString("test_user:x-pack-test-password".getBytes(StandardCharsets.UTF_8));
19+
return Settings.builder()
20+
.put(ThreadContext.PREFIX + ".Authorization", token)
21+
.build();
22+
}
23+
}

0 commit comments

Comments
 (0)