Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into change-whitesource-…
Browse files Browse the repository at this point in the history
…base-branch
  • Loading branch information
zelinh committed Dec 29, 2021
2 parents a7a2a12 + 65804d2 commit e485612
Show file tree
Hide file tree
Showing 235 changed files with 660 additions and 5,891 deletions.
1 change: 1 addition & 0 deletions .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ BWC_VERSION:
- "1.2.1"
- "1.2.2"
- "1.2.3"
- "1.2.4"
- "1.3.0"
14 changes: 4 additions & 10 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Load Excludes
run: |
LYCHEE_EXCLUDE=$(sed -e :a -e 'N;s/\n/ /;ta' .lycheeexclude)
echo "LYCHEE_EXCLUDE=$LYCHEE_EXCLUDE" >> $GITHUB_ENV
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@master
uses: lycheeverse/lychee-action@v1.2.0
with:
args: --accept=200,403,429 --exclude ${{ env.LYCHEE_EXCLUDE }} --exclude-mail "**/*.html" "**/*.md" "**/*.txt" "**/*.json"
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Fail if there were link errors
run: exit ${{ steps.lychee.outputs.exit_code }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
File renamed without changes.
6 changes: 3 additions & 3 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ yamlRestTest’s and javaRestTest’s are easy to identify, since they are found

If in doubt about which command to use, simply run <gradle path>:check

Note that the REST tests, like all the integration tests, can be run against an external cluster by specifying the `tests.cluster` property, which if present needs to contain a comma separated list of nodes to connect to (e.g. localhost:9300). A transport client will be created based on that and used for all the before|after test operations, and to extract the http addresses of the nodes so that REST requests can be sent to them.
Note that the REST tests, like all the integration tests, can be run against an external cluster by specifying the `tests.cluster` property, which if present needs to contain a comma separated list of nodes to connect to (e.g. localhost:9300).

# Testing packaging

Expand Down Expand Up @@ -363,11 +363,11 @@ These test tasks can use the `--tests`, `--info`, and `--debug` parameters just

# Testing backwards compatibility

Backwards compatibility tests exist to test upgrading from each supported version to the current version.
Backwards compatibility tests exist to test upgrading from each supported version to the current version.

The test can be run for any versions which the current version will be compatible with. Tests are run for released versions download the distributions from the artifact repository, see [DistributionDownloadPlugin](./buildSrc/src/main/java/org/opensearch/gradle/DistributionDownloadPlugin.java) for the repository location. Tests are run for versions that are not yet released automatically check out the branch and build from source to get the distributions, see [BwcVersions](./buildSrc/src/main/java/org/opensearch/gradle/BwcVersions.java) and [distribution/bwc/build.gradle](./distribution/bwc/build.gradle) for more information.

The minimum JDK versions for runtime and compiling need to be installed, and environment variables `JAVAx_HOME`, such as `JAVA8_HOME`, pointing to the JDK installations are required to run the tests against unreleased versions, since the distributions are created by building from source. The required JDK versions for each branch are located at [.ci/java-versions.properties](.ci/java-versions.properties), see [BwcSetupExtension](./buildSrc/src/main/java/org/opensearch/gradle/internal/BwcSetupExtension.java) for more information.
The minimum JDK versions for runtime and compiling need to be installed, and environment variables `JAVAx_HOME`, such as `JAVA8_HOME`, pointing to the JDK installations are required to run the tests against unreleased versions, since the distributions are created by building from source. The required JDK versions for each branch are located at [.ci/java-versions.properties](.ci/java-versions.properties), see [BwcSetupExtension](./buildSrc/src/main/java/org/opensearch/gradle/internal/BwcSetupExtension.java) for more information.

To run all the backwards compatibility tests use:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
@State(Scope.Thread)
@Fork(value = 1)
public class TermsReduceBenchmark {
private final SearchModule searchModule = new SearchModule(Settings.EMPTY, false, emptyList());
private final SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
private final NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(searchModule.getNamedWriteables());
private final SearchPhaseController controller = new SearchPhaseController(
namedWriteableRegistry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ static void setupDependencies(Project project, SourceSet sourceSet) {
} else {
project.getDependencies()
.add(sourceSet.getImplementationConfigurationName(), "org.opensearch.test:framework:" + VersionProperties.getOpenSearch());
// The log4j-core is optional dependency of the org.opensearch.test:framework. needs explicit introduction
project.getDependencies()
.add(
sourceSet.getImplementationConfigurationName(),
"org.apache.logging.log4j:log4j-core:" + VersionProperties.getVersions().get("log4j")
);
}

}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jackson = 2.12.5
snakeyaml = 1.26
icu4j = 62.1
supercsv = 2.4.0
log4j = 2.17.0
log4j = 2.17.1
slf4j = 1.6.2

# when updating the JNA version, also update the version in buildSrc/build.gradle
Expand Down
6 changes: 3 additions & 3 deletions client/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ gradlew -p client/benchmark run --args ' rest bulk localhost build/documents-2.j

The parameters are all in the `'`s and are in order:

* Client type: Use either "rest" or "transport"
* Client type: Use "rest"
* Benchmark type: Use either "bulk" or "search"
* Benchmark target host IP (the host where OpenSearch is running)
* full path to the file that should be bulk indexed
Expand All @@ -54,9 +54,9 @@ Example invocation:

The parameters are in order:

* Client type: Use either "rest" or "transport"
* Client type: Use "rest"
* Benchmark type: Use either "bulk" or "search"
* Benchmark target host IP (the host where OpenSearch is running)
* name of the index
* a search request body (remember to escape double quotes). The `TransportClientBenchmark` uses `QueryBuilders.wrapperQuery()` internally which automatically adds a root key `query`, so it must not be present in the command line parameter.
* a search request body (remember to escape double quotes).
* A comma-separated list of target throughput rates
6 changes: 0 additions & 6 deletions client/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ dependencies {
api project(":client:rest")
// bottleneck should be the client, not OpenSearch
api project(path: ':client:client-benchmark-noop-api-plugin')
// for transport client
api project(":server")
api project(":client:transport")
api project(':modules:transport-netty4')
api project(':modules:reindex')
api project(':modules:lang-mustache')
api project(':modules:percolator')
}

// No licenses for our benchmark deps (we don't ship benchmarks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
package org.opensearch.client.benchmark;

import org.opensearch.client.benchmark.rest.RestClientBenchmark;
import org.opensearch.client.benchmark.transport.TransportClientBenchmark;
import org.opensearch.common.SuppressForbidden;

import java.util.Arrays;
Expand All @@ -42,16 +41,11 @@ public class BenchmarkMain {
public static void main(String[] args) throws Exception {
String type = args[0];
AbstractBenchmark<?> benchmark = null;
switch (type) {
case "transport":
benchmark = new TransportClientBenchmark();
break;
case "rest":
benchmark = new RestClientBenchmark();
break;
default:
System.err.println("Unknown client type [" + type + "]");
System.exit(1);
if ("rest".equals(type)) {
benchmark = new RestClientBenchmark();
} else {
System.err.println("Unknown client type [" + type + "]");
System.exit(1);
}
benchmark.run(Arrays.copyOfRange(args, 1, args.length));
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,6 @@ static Request getIndex(GetIndexRequest getIndexRequest) {
*/
@Deprecated
static Request indicesExist(org.opensearch.action.admin.indices.get.GetIndexRequest getIndexRequest) {
// this can be called with no indices as argument by transport client, not via REST though
if (getIndexRequest.indices() == null || getIndexRequest.indices().length == 0) {
throw new IllegalArgumentException("indices are mandatory");
}
Expand All @@ -565,7 +564,6 @@ static Request indicesExist(org.opensearch.action.admin.indices.get.GetIndexRequ
}

static Request indicesExist(GetIndexRequest getIndexRequest) {
// this can be called with no indices as argument by transport client, not via REST though
if (getIndexRequest.indices() == null || getIndexRequest.indices().length == 0) {
throw new IllegalArgumentException("indices are mandatory");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected interface AsyncMethodNoRequest<Response> {

private static class HighLevelClient extends RestHighLevelClient {
private HighLevelClient(RestClient restClient) {
super(restClient, (client) -> {}, new SearchModule(Settings.EMPTY, false, Collections.emptyList()).getNamedXContents());
super(restClient, (client) -> {}, new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedXContents());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected void assertInstances(QueryBuilder serverInstance, CountRequest clientT

@Override
protected NamedXContentRegistry xContentRegistry() {
return new NamedXContentRegistry(new SearchModule(Settings.EMPTY, false, Collections.emptyList()).getNamedXContents());
return new NamedXContentRegistry(new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedXContents());
}

public void testIllegalArguments() {
Expand Down
61 changes: 0 additions & 61 deletions client/transport/build.gradle

This file was deleted.

Loading

0 comments on commit e485612

Please sign in to comment.