-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.17] Add support for addition configuration files to test clusters …
…framework (#92579) (#92603) * Add support for addition configuration files to test clusters framework (#92579) This adds the ability to supply arbitrary files to the config directory of cluster nodes. Typically, this is used for security use cases, such as providing for SSL certificates and trust stores. This commit adds a few other features to enable more testing ues cases as well, such as the ability to restart a cluster, as well as explicit ordering of test cases withing a test class. This is needed for test suites that need to execute some tests, restart the cluster, then execute more in a particular order. # Conflicts: # test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/LocalClusterHandle.java # x-pack/plugin/security/qa/basic-enable-security/build.gradle # x-pack/plugin/security/qa/basic-enable-security/src/javaRestTest/java/org/elasticsearch/xpack/security/EnableSecurityOnBasicLicenseIT.java # x-pack/qa/multi-node/src/javaRestTest/java/org/elasticsearch/multi_node/GlobalCheckpointSyncActionIT.java * Fix static initialization of random value * Remove unused imports * Spotless
- Loading branch information
1 parent
223786c
commit 0f28d1f
Showing
19 changed files
with
311 additions
and
183 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
test/framework/src/main/java/org/elasticsearch/test/AnnotationTestOrdering.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.test; | ||
|
||
import com.carrotsearch.randomizedtesting.TestMethodAndParams; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
import java.util.Comparator; | ||
|
||
/** | ||
* Test case ordering to be used in conjunction with {@link com.carrotsearch.randomizedtesting.annotations.TestCaseOrdering}. Tests are | ||
* ordered with respect to ordinals defined with {@link Order} annotations placed on individual test methods. | ||
*/ | ||
public class AnnotationTestOrdering implements Comparator<TestMethodAndParams> { | ||
@Override | ||
public int compare(TestMethodAndParams o1, TestMethodAndParams o2) { | ||
return Integer.compare( | ||
o1.getTestMethod().getAnnotation(Order.class).value(), | ||
o2.getTestMethod().getAnnotation(Order.class).value() | ||
); | ||
} | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.METHOD) | ||
@Inherited | ||
public @interface Order { | ||
int value(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.