Skip to content

Commit

Permalink
Refactor BWC tests into sub project (#359)
Browse files Browse the repository at this point in the history
Creates new sub project for BWC testing. This will allow us to
modularize the build files better. Removes the checked in zip 
artifacts from repo.

Signed-off-by: John Mazanec <jmazane@amazon.com>
  • Loading branch information
jmazanec15 authored Apr 11, 2022
1 parent a8774ac commit 3fe2abf
Show file tree
Hide file tree
Showing 18 changed files with 242 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Run k-NN Backwards Compatibility Tests
run: |
echo "Running backwards compatibility tests ..."
./gradlew bwcTestSuite -Dtests.security.manager=false
./gradlew :qa:bwc:bwcTestSuite
- name: Upload Coverage Report
uses: codecov/codecov-action@v1
Expand Down
12 changes: 5 additions & 7 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,15 @@ 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:

1. Mixed cluster test: `./gradlew knnBwcCluster#mixedClusterTask -Dtests.security.manager=false`
2. Rolling upgrade tests: `./gradlew knnBwcCluster#rollingUpgradeClusterTask -Dtests.security.manager=false`
3. Full restart upgrade tests: `./gradlew knnBwcCluster#fullRestartClusterTask -Dtests.security.manager=false`
4. `./gradlew bwcTestSuite -Dtests.security.manager=false` is used to run all the above bwc tests together.
1. Rolling upgrade tests: `./gradlew :qa:bwc:testRollingUpgrade`
2. Full restart upgrade tests: `./gradlew :qa:bwc:testRestartUpgrade`
3. `./gradlew :qa:bwc: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 bwcTestSuite -Dbwc.version=1.0.0.0-SNAPSHOT
./gradlew :qa:bwc:bwcTestSuite -Dbwc.version=1.0.0
```
Here, we are testing BWC Tests with BWC version of plugin as 1.0.0.0. Make sure to add the binary file of that version in the bwc directory in resources.
Here, we are testing BWC Tests with BWC version of plugin as 1.0.0.

### Adding new tests

Expand Down
5 changes: 5 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Do not creating branches in the upstream repo, use your fork, for the exception

Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v2.0.0`, as well as `backport`. Use release labels to target an issue or a PR for a given release. See [MAINTAINERS](MAINTAINERS.md#triage-open-issues) for more information on triaging issues.

## Backwards Compatibility

[The backwards compatibility test suite](qa/bwc) is used to ensure upgrades to the current version are successful.
When releasing a new version, update the `bwc.version` to the latest, previous minor version in [gradle.properties](gradle.properties).

## Releasing

The release process is standard across repositories in this org and is run by a release manager volunteering from amongst [MAINTAINERS](MAINTAINERS.md).
Expand Down
22 changes: 9 additions & 13 deletions build-tools/knnplugin-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,15 @@ jacocoTestReport {
}
}

afterEvaluate {
jacocoTestReport.dependsOn integTest

allprojects{
afterEvaluate {
jacocoTestReport.dependsOn integTest

testClusters.integTest {
jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('javaagent:','javaagent:/')
systemProperty 'com.sun.management.jmxremote', "true"
systemProperty 'com.sun.management.jmxremote.authenticate', "false"
systemProperty 'com.sun.management.jmxremote.port', "7777"
systemProperty 'com.sun.management.jmxremote.ssl', "false"
systemProperty 'java.rmi.server.hostname', "127.0.0.1"
}
testClusters.integTest {
jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('javaagent:','javaagent:/')
systemProperty 'com.sun.management.jmxremote', "true"
systemProperty 'com.sun.management.jmxremote.authenticate', "false"
systemProperty 'com.sun.management.jmxremote.port', "7777"
systemProperty 'com.sun.management.jmxremote.ssl', "false"
systemProperty 'java.rmi.server.hostname', "127.0.0.1"
}
}

3 changes: 3 additions & 0 deletions build-tools/repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*/

repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}

Loading

0 comments on commit 3fe2abf

Please sign in to comment.