From ad4acec6c64dc7474591f19f3cd054ea69c7b781 Mon Sep 17 00:00:00 2001 From: Varun Jain Date: Tue, 2 Jan 2024 12:39:43 -0800 Subject: [PATCH 1/3] Adding information on BWC tests in Developer guide Signed-off-by: Varun Jain --- DEVELOPER_GUIDE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 0ce29d811..1f7fc3271 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -11,6 +11,8 @@ - [Run Single-node Cluster Locally](#run-single-node-cluster-locally) - [Run Multi-node Cluster Locally](#run-multi-node-cluster-locally) - [Debugging](#debugging) + - [Backwards Compatibility Testing](#backwards-compatibility-testing) + - [Adding new tests](#adding-new-tests) - [Supported configurations](#supported-configurations) - [Submitting Changes](#submitting-changes) @@ -184,6 +186,25 @@ Additionally, it is possible to attach one debugger to the cluster JVM and anoth ./gradlew :integTest -Dtest.debug=1 -Dcluster.debug=1 ``` +## Backwards Compatibility Testing + +The purpose of Backwards Compatibility Testing and different types of BWC tests are explained [here](https://github.com/opensearch-project/opensearch-plugins/blob/main/TESTING.md#backwards-compatibility-testing) + +Use these commands to run BWC tests for k-NN: +1. Rolling upgrade tests: `./gradlew :qa:rolling-upgrade:testRollingUpgrade` +2. Full restart upgrade tests: `./gradlew :qa:restart-upgrade:testAgainstNewCluster` +3. `./gradlew :qa:bwcTestSuite` is used to run all the above bwc tests together. + +Use this command to run BWC tests for a given Backwards Compatibility Version: +``` +./gradlew :qa:bwcTestSuite -Dbwc.version=2.9.0 +``` +Here, we are testing BWC Tests with BWC version of plugin as 2.9.0. + +### Adding new tests + +Before adding any new tests to Backward Compatibility Tests, we should be aware that the tests in BWC are not independent. While creating an index, a test cannot use the same index name if it is already used in other tests. + ### Supported configurations By default, neural-search plugin supports `lucene` k-NN engine for local runs. Below is the sample request for creating of new index using this engine: From 8f49584a674b110303e7d802648f091c1282052e Mon Sep 17 00:00:00 2001 From: Varun Jain Date: Wed, 3 Jan 2024 15:06:35 -0800 Subject: [PATCH 2/3] Updating Developer guide Signed-off-by: Varun Jain --- DEVELOPER_GUIDE.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 68b7a4c38..cad23695a 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -190,16 +190,19 @@ Additionally, it is possible to attach one debugger to the cluster JVM and anoth The purpose of Backwards Compatibility Testing and different types of BWC tests are explained [here](https://github.com/opensearch-project/opensearch-plugins/blob/main/TESTING.md#backwards-compatibility-testing) -Use these commands to run BWC tests for k-NN: +Use these commands to run BWC tests for neural search: 1. Rolling upgrade tests: `./gradlew :qa:rolling-upgrade:testRollingUpgrade` 2. Full restart upgrade tests: `./gradlew :qa:restart-upgrade:testAgainstNewCluster` 3. `./gradlew :qa:bwcTestSuite` is used to run all the above bwc tests together. +bwc.version stands for the older version of OpenSearch against which one needs to check the compatibility with the current version. +The details regarding all bwc versions of OpenSearch can be found [here](https://github.com/opensearch-project/OpenSearch/blob/main/libs/core/src/main/java/org/opensearch/Version.java). Use this command to run BWC tests for a given Backwards Compatibility Version: ``` ./gradlew :qa:bwcTestSuite -Dbwc.version=2.9.0 ``` Here, we are testing BWC Tests with BWC version of plugin as 2.9.0. +The tests will not run on MAC OS due to issues coming from the OS. ### Adding new tests From d477ecf7de12698cbd92cdb5ad81b73c94b10138 Mon Sep 17 00:00:00 2001 From: Varun Jain Date: Fri, 5 Jan 2024 11:24:25 -0800 Subject: [PATCH 3/3] Add spotlessApply in ./gradlew build Signed-off-by: Varun Jain --- DEVELOPER_GUIDE.md | 3 ++- build.gradle | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index cad23695a..3af2dd659 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -188,7 +188,8 @@ Additionally, it is possible to attach one debugger to the cluster JVM and anoth ## Backwards Compatibility Testing -The purpose of Backwards Compatibility Testing and different types of BWC tests are explained [here](https://github.com/opensearch-project/opensearch-plugins/blob/main/TESTING.md#backwards-compatibility-testing) +The purpose of Backwards Compatibility Testing and different types of BWC tests are explained [here](https://github.com/opensearch-project/opensearch-plugins/blob/main/TESTING.md#backwards-compatibility-testing). The BWC tests (i.e. Restart-Upgrade, Mixed-Cluster and Rolling-Upgrade scenarios) should be added with any new feature being added to Neural Search. +The current design has mixed-cluster tests combined with rolling-upgrade tests in the same test class for [example](https://github.com/opensearch-project/neural-search/blob/main/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/SemanticSearchIT.java). Use these commands to run BWC tests for neural search: 1. Rolling upgrade tests: `./gradlew :qa:rolling-upgrade:testRollingUpgrade` diff --git a/build.gradle b/build.gradle index ac0ebaa9d..dd48066db 100644 --- a/build.gradle +++ b/build.gradle @@ -194,6 +194,7 @@ project.tasks.delombok.dependsOn(extractKnnJar) compileJava { dependsOn extractKnnJar + dependsOn spotlessApply options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) } compileTestJava {