Replace blacklist in Gradle build environment configuration (#2752)

- Replace `blacklist` with `denylist` in all `tests.rest.blacklist` and `REST_TESTS_BLACKLIST`
Signed-off-by: Tianli Feng <ftianli@amazon.com>
This commit is contained in:
Tianli Feng 2022-04-05 17:48:39 -07:00 committed by GitHub
parent 1dbeda0f32
commit ed040e9f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -245,7 +245,7 @@ The YAML REST tests support all the options provided by the randomized runner, p
- `tests.rest.suite`: comma separated paths of the test suites to be run (by default loaded from /rest-api-spec/test). It is possible to run only a subset of the tests providing a sub-folder or even a single yaml file (the default /rest-api-spec/test prefix is optional when files are loaded from classpath) e.g. `-Dtests.rest.suite=index,get,create/10_with_id` - `tests.rest.suite`: comma separated paths of the test suites to be run (by default loaded from /rest-api-spec/test). It is possible to run only a subset of the tests providing a sub-folder or even a single yaml file (the default /rest-api-spec/test prefix is optional when files are loaded from classpath) e.g. `-Dtests.rest.suite=index,get,create/10_with_id`
- `tests.rest.blacklist`: comma separated globs that identify tests that are denylisted and need to be skipped e.g. `-Dtests.rest.blacklist=index/**/Index document,get/10_basic/**` - `tests.rest.denylist`: comma separated globs that identify tests that are denylisted and need to be skipped e.g. `-Dtests.rest.denylist=index/**/Index document,get/10_basic/**`
Java REST tests can be run with the "javaRestTest" task. Java REST tests can be run with the "javaRestTest" task.

View File

@ -190,7 +190,7 @@ internalClusterTest {
} }
yamlRestTest { yamlRestTest {
systemProperty 'tests.rest.blacklist', ( systemProperty 'tests.rest.denylist', (
useFixture ? useFixture ?
['repository_s3/50_repository_ecs_credentials/*'] ['repository_s3/50_repository_ecs_credentials/*']
: :
@ -246,7 +246,7 @@ if (useFixture) {
setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) setClasspath(yamlRestTestSourceSet.getRuntimeClasspath())
// Minio only supports a single access key, see https://github.com/minio/minio/pull/5968 // Minio only supports a single access key, see https://github.com/minio/minio/pull/5968
systemProperty 'tests.rest.blacklist', [ systemProperty 'tests.rest.denylist', [
'repository_s3/30_repository_temporary_credentials/*', 'repository_s3/30_repository_temporary_credentials/*',
'repository_s3/40_repository_ec2_credentials/*', 'repository_s3/40_repository_ec2_credentials/*',
'repository_s3/50_repository_ecs_credentials/*' 'repository_s3/50_repository_ecs_credentials/*'
@ -272,7 +272,7 @@ if (useFixture) {
SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME)
setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs())
setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) setClasspath(yamlRestTestSourceSet.getRuntimeClasspath())
systemProperty 'tests.rest.blacklist', [ systemProperty 'tests.rest.denylist', [
'repository_s3/10_basic/*', 'repository_s3/10_basic/*',
'repository_s3/20_repository_permanent_credentials/*', 'repository_s3/20_repository_permanent_credentials/*',
'repository_s3/30_repository_temporary_credentials/*', 'repository_s3/30_repository_temporary_credentials/*',

View File

@ -200,7 +200,7 @@ public class ReproduceInfoPrinter extends RunListener {
public ReproduceErrorMessageBuilder appendClientYamlSuiteProperties() { public ReproduceErrorMessageBuilder appendClientYamlSuiteProperties() {
return appendProperties( return appendProperties(
OpenSearchClientYamlSuiteTestCase.REST_TESTS_SUITE, OpenSearchClientYamlSuiteTestCase.REST_TESTS_SUITE,
OpenSearchClientYamlSuiteTestCase.REST_TESTS_BLACKLIST OpenSearchClientYamlSuiteTestCase.REST_TESTS_DENYLIST
); );
} }

View File

@ -89,14 +89,14 @@ public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTe
public static final String REST_TESTS_SUITE = "tests.rest.suite"; public static final String REST_TESTS_SUITE = "tests.rest.suite";
/** /**
* Property that allows to denylist some of the REST tests based on a comma separated list of globs * Property that allows to denylist some of the REST tests based on a comma separated list of globs
* e.g. "-Dtests.rest.blacklist=get/10_basic/*" * e.g. "-Dtests.rest.denylist=get/10_basic/*"
*/ */
public static final String REST_TESTS_BLACKLIST = "tests.rest.blacklist"; public static final String REST_TESTS_DENYLIST = "tests.rest.denylist";
/** /**
* We use tests.rest.blacklist in build files to denylist tests; this property enables a user to add additional denylisted tests on * We use tests.rest.denylist in build files to denylist tests; this property enables a user to add additional denylisted tests on
* top of the tests denylisted in the build. * top of the tests denylisted in the build.
*/ */
public static final String REST_TESTS_BLACKLIST_ADDITIONS = "tests.rest.blacklist_additions"; public static final String REST_TESTS_DENYLIST_ADDITIONS = "tests.rest.denylist_additions";
/** /**
* Property that allows to control whether spec validation is enabled or not (default true). * Property that allows to control whether spec validation is enabled or not (default true).
*/ */
@ -154,12 +154,12 @@ public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTe
clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion); clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion);
restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType()); restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType());
adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false); adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false);
final String[] denylist = resolvePathsProperty(REST_TESTS_BLACKLIST, null); final String[] denylist = resolvePathsProperty(REST_TESTS_DENYLIST, null);
denylistPathMatchers = new ArrayList<>(); denylistPathMatchers = new ArrayList<>();
for (final String entry : denylist) { for (final String entry : denylist) {
denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry)); denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry));
} }
final String[] denylistAdditions = resolvePathsProperty(REST_TESTS_BLACKLIST_ADDITIONS, null); final String[] denylistAdditions = resolvePathsProperty(REST_TESTS_DENYLIST_ADDITIONS, null);
for (final String entry : denylistAdditions) { for (final String entry : denylistAdditions) {
denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry)); denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry));
} }