Skip to content

Adding gradle task for running integ tests in remote cluster#266

Merged
martin-gaievski merged 4 commits intoopensearch-project:mainfrom
martin-gaievski:add_support_for_integ_tests_with_remote_cluster
Jan 25, 2022
Merged

Adding gradle task for running integ tests in remote cluster#266
martin-gaievski merged 4 commits intoopensearch-project:mainfrom
martin-gaievski:add_support_for_integ_tests_with_remote_cluster

Conversation

@martin-gaievski
Copy link
Copy Markdown
Member

Signed-off-by: Martin Gaievski gaievski@amazon.com

Description

Adding integTestRemote gradle task that allows to run kNN integration tests in remote cluster

Issues Resolved

#198

Check List

  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 21, 2022

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.37%. Comparing base (cf53695) to head (c2cdb94).
⚠️ Report is 807 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #266   +/-   ##
=========================================
  Coverage     83.37%   83.37%           
  Complexity      884      884           
=========================================
  Files           127      127           
  Lines          3832     3832           
  Branches        361      361           
=========================================
  Hits           3195     3195           
  Misses          475      475           
  Partials        162      162           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martin-gaievski martin-gaievski marked this pull request as ready for review January 21, 2022 23:57
@martin-gaievski martin-gaievski requested a review from a team January 21, 2022 23:57
@martin-gaievski martin-gaievski added v1.3.0 Issues and PRs related to version 1.3.0 Enhancements Increases software capabilities beyond original client specifications labels Jan 21, 2022
junqiu-lei
junqiu-lei previously approved these changes Jan 22, 2022
Copy link
Copy Markdown
Member

@jmazanec15 jmazanec15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martin-gaievski When I ran it, BWC failed:

REPRODUCE WITH: ./gradlew ':integTestRemote' --tests "org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT.testBackwardsCompatibility" -Dtests.seed=47B9EB07745E3976 -Dtests.security.manager=true -Dtests.locale=cs -Dtests.timezone=Pacific/Port_Moresby -Druntime.java=14

org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT > testBackwardsCompatibility FAILED
    java.lang.NullPointerException
        at __randomizedtesting.SeedInfo.seed([47B9EB07745E3976:AC86D6C90E85ECFC]:0)
        at org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT$ClusterType.parse(KNNBackwardsCompatibilityIT.java:77)
        at org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT.getClusterType(KNNBackwardsCompatibilityIT.java:91)
        at org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT.testBackwardsCompatibility(KNNBackwardsCompatibilityIT.java:98)


Suite: Test class org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT
  1> [2022-01-25T03:25:47,877][INFO ][o.o.k.b.KNNBackwardsCompatibilityIT] [testBackwardsCompatibility] before test
  1> [2022-01-25T03:25:47,883][INFO ][o.o.k.b.KNNBackwardsCompatibilityIT] [testBackwardsCompatibility] initializing REST clients against [http://localhost:9200]
  1> [2022-01-25T03:25:48,046][INFO ][o.o.k.b.KNNBackwardsCompatibilityIT] [testBackwardsCompatibility] after test
  2> REPRODUCE WITH: ./gradlew ':integTestRemote' --tests "org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT.testBackwardsCompatibility" -Dtests.seed=47B9EB07745E3976 -Dtests.security.manager=true -Dtests.locale=cs -Dtests.timezone=Pacific/Port_Moresby -Druntime.java=14
  2> java.lang.NullPointerException
        at __randomizedtesting.SeedInfo.seed([47B9EB07745E3976:AC86D6C90E85ECFC]:0)
        at org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT$ClusterType.parse(KNNBackwardsCompatibilityIT.java:77)
        at org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT.getClusterType(KNNBackwardsCompatibilityIT.java:91)
        at org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT.testBackwardsCompatibility(KNNBackwardsCompatibilityIT.java:98)
  2> NOTE: leaving temporary files on disk at: /home/test/k-NN/build/testrun/integTestRemote/temp/org.opensearch.knn.bwc.KNNBackwardsCompatibilityIT_47B9EB07745E3976-001
  2> NOTE: test params are: codec=Asserting(Lucene87): {}, docValues:{}, maxPointsInLeafNode=1640, maxMBSortInHeap=5.364859996135681, sim=Asserting(RandomSimilarity(queryNorm=false): {}), locale=cs, timezone=Pacific/Port_Moresby
  2> NOTE: Linux 5.10.25-linuxkit amd64/Oracle Corporation 14 (64-bit)/cpus=2,threads=1,free=356098048,total=536870912
  2> NOTE: All tests run in this JVM: [PainlessScriptScoringIT, KNNScriptScoringIT, RestLegacyKNNStatsHandlerIT, RestLegacyKNNWarmupHandlerIT, RestDeleteModelHandlerIT, RestKNNStatsHandlerIT, RestGetModelHandlerIT, RestSearchModelHandlerIT, RestKNNWarmupHandlerIT, RestTrainModelHandlerIT, KNNBackwardsCompatibilityIT]

Comment thread build.gradle
// Run tests with remote cluster only if rest case is defined
if (System.getProperty("tests.rest.cluster") != null) {
filter {
includeTestsMatching "org.opensearch.knn.*IT"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, you should add this in the filter to fix the BWC issue which Jack mentioned in review comments
excludeTestsMatching "org.opensearch.knn.bwc.*IT"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Naveen, it's a good point as we need to have multiple external clusters for BWC. For now I've added bwc tests to exclusion matching rule

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
jmazanec15
jmazanec15 previously approved these changes Jan 24, 2022
Comment thread DEVELOPER_GUIDE.md Outdated
Integration tests can be run with remote cluster. For that run the following command and replace host/port/cluster name values with ones for the target cluster:

```
./gradlew :integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="integTest-0" -Dhttps=false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we include an example with secure cluster (username/password) as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that makes sense. Let me update the guide

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added instructions for secure cluster

Signed-off-by: Martin Gaievski <gaievski@amazon.com>

// Create index with 1 primary and numNodes-1 replicas so that the data will be on every node in the cluster
int numNodes = Integer.parseInt(System.getProperty("cluster.number_of_nodes"));
int numNodes = Integer.parseInt(System.getProperty("cluster.number_of_nodes", "1"));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added default value for number of clusters as 1, this may be missing for remote tests and lead to NPE

…script

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
@martin-gaievski martin-gaievski merged commit b781e26 into opensearch-project:main Jan 25, 2022
martin-gaievski added a commit to martin-gaievski/k-NN that referenced this pull request Mar 7, 2022
…rch-project#266)

* Adding gradle task for running integ tests in remote cluster

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
martin-gaievski added a commit to martin-gaievski/k-NN that referenced this pull request Mar 7, 2022
…rch-project#266)

* Adding gradle task for running integ tests in remote cluster

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
martin-gaievski added a commit to martin-gaievski/k-NN that referenced this pull request Mar 30, 2022
…rch-project#266)

* Adding gradle task for running integ tests in remote cluster

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
jingqimao77-spec pushed a commit to jingqimao77-spec/k-NN that referenced this pull request Mar 15, 2026
…rch-project#266)

* Adding gradle task for running integ tests in remote cluster

Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancements Increases software capabilities beyond original client specifications v1.3.0 Issues and PRs related to version 1.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants