Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1713: add multi-cluster IT testing class for Cross-Cluster support #319

Conversation

acarbonetto
Copy link

Description

Adds multiClusterSearch IT test task that creates a 3-node cluster and additional cross-cluster for CrossClusterSearchIT testing, with the Security plugin enabled.

This will bring IT test infrastructure more in-step with the release workflow to avoid security-plugin issues in the future.

Issues Resolved

opensearch-project#1713

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed 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: acarbonetto <andrewc@bitquilltech.com>
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #319 (c23ed04) into integ-add-security-plugin-it-1713 (d00dc4d) will not change coverage.
The diff coverage is n/a.

@@                         Coverage Diff                          @@
##             integ-add-security-plugin-it-1713     #319   +/-   ##
====================================================================
  Coverage                                97.42%   97.42%           
  Complexity                                4647     4647           
====================================================================
  Files                                      408      408           
  Lines                                    11526    11526           
  Branches                                   839      839           
====================================================================
  Hits                                     11229    11229           
  Misses                                     290      290           
  Partials                                     7        7           
Flag Coverage Δ
sql-engine 97.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -105,10 +105,10 @@ protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOE
}

// Modified from initClient in OpenSearchRestTestCase
public void initRemoteClient() throws IOException {
public void initRemoteClient(String clusterName) throws IOException {

Choose a reason for hiding this comment

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

Does this not reduce potential future reuse of this function?

Copy link
Author

Choose a reason for hiding this comment

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

The cluster name is defined in the gradle task. Sean hardcoded the name in a static variable, so this only used to work with the remoteCluster, and now it works with whatever the gradle task has named the cluster.
So... no. I think this is more reusable?

Copy link

@GumpacG GumpacG left a comment

Choose a reason for hiding this comment

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

Can you also add a test that checks if https url works. I think default port when security enabled is 443.

./gradlew :integ-test:integTest || echo "* Integration test failed" >> report.log
./gradlew :integ-test:multiClusterSearch || echo "* Multi-Cluster Search tests failed" >> report.log
Copy link

Choose a reason for hiding this comment

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

Since this is for every push, can we run it after doctests? For development, doctests are more relevant to us than testing with security enabled.

Copy link
Author

Choose a reason for hiding this comment

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

I thought this was akin to Integration Testing, just against a different cluster. The tests run are integration tests.
I would categorize doctests are more API testing which seems more highlevel... but is just another form of Integration Test.
So... 🤷

Copy link

Choose a reason for hiding this comment

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

Right it's more so when we push and we want to know if all integ test and doctest pass we would have to wait x time for mutlicluster IT to finish (spin up, run tests, and clean up) before getting our results. While the ITs added here are really only relevant for release testing.

Choose a reason for hiding this comment

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

This CI runs on demand only

Choose a reason for hiding this comment

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

If you want to run these tests in every push/PR, add it to sql-test-and-build-workflow.yml

@@ -301,7 +304,7 @@ integTest {
exclude 'org/opensearch/sql/jdbc/**'

// Exclude this IT until running IT with security plugin enabled is ready
exclude 'org/opensearch/sql/ppl/CrossClusterSearchIT.class'
// exclude 'org/opensearch/sql/ppl/CrossClusterSearchIT.class'
Copy link

Choose a reason for hiding this comment

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

Delete

Choose a reason for hiding this comment

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

☝️

Signed-off-by: acarbonetto <andrewc@bitquilltech.com>
@@ -301,7 +304,7 @@ integTest {
exclude 'org/opensearch/sql/jdbc/**'

// Exclude this IT until running IT with security plugin enabled is ready
exclude 'org/opensearch/sql/ppl/CrossClusterSearchIT.class'
// exclude 'org/opensearch/sql/ppl/CrossClusterSearchIT.class'

Choose a reason for hiding this comment

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

☝️

./gradlew :integ-test:integTest || echo "* Integration test failed" >> report.log
./gradlew :integ-test:multiClusterSearch || echo "* Multi-Cluster Search tests failed" >> report.log

Choose a reason for hiding this comment

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

If you want to run these tests in every push/PR, add it to sql-test-and-build-workflow.yml

import org.opensearch.client.ResponseException;
import org.opensearch.sql.ppl.PPLIntegTestCase;

public class CrossClusterSearchIT extends PPLIntegTestCase {

Choose a reason for hiding this comment

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

Probably add a comment describing difference with ppl/CrossClusterSearchIT

Comment on lines +531 to +533
systemProperty "https", System.getProperty("https")
systemProperty "user", System.getProperty("user")
systemProperty "password", System.getProperty("password")

Choose a reason for hiding this comment

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

This is no-op, can be removed

Comment on lines +493 to +495
}

testClusters {

Choose a reason for hiding this comment

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

Suggested change
}
testClusters {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants