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

Run IT tests with security plugin #335

Merged
merged 13 commits into from
Aug 17, 2023

Conversation

Yury-Fridlyand
Copy link

@Yury-Fridlyand Yury-Fridlyand commented Aug 8, 2023

Description

This PR adds a new IT gradle task: integTestWithSecurity. It starts a cluster with security plugin installed (it takes latest snapshot), configures cluster, http client for tests and runs one test which required to be run with security plugin.
A new GHA is added which runs this test task.

This PR temporary includes files from opensearch-project#1943.

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.

@Yury-Fridlyand Yury-Fridlyand changed the title Dev it with security Run IT tests with security plugin Aug 8, 2023
Copy link

@peternied peternied left a comment

Choose a reason for hiding this comment

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

I am a big fan of integration test around security scenarios, added a couple of comments/considerations.

@@ -57,6 +60,20 @@ ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.TXT')
noticeFile = rootProject.file('NOTICE')

getSecurityPluginDownloadLink = { ->
var repo = "https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/plugin/" +

Choose a reason for hiding this comment

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

The Security Plugin maintainers (myself included) have had trouble with build breaks and fixing them in a timely manner - it would be unfortunate for your integration tests to be flaky due to downstream issues. This isn't an issue with release builds with the trade-off of longer time between updates.

setting 'plugins.security.ssl.transport.enforce_hostname_verification', 'false'
// https is disabled, because `OpenSearchCluster` is hardcoded to validate cluster health by http
// refer how IT framework implemented in security plugin and reuse/copy to activate https
setting 'plugins.security.ssl.http.enabled', 'false'

Choose a reason for hiding this comment

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

There are some features of the security plugin - such as being able to make changes to the security configuration dynamically that will not be possible with this setting disabled. Depends if your tests will ever need to exercise that kind of functionality.

Choose a reason for hiding this comment

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

This issue was raised because Release testing runs IT tests with the security plugin. If we can catch errors early, we can avoid blocking release.

integ-test/rc/esnode-key.pem Outdated Show resolved Hide resolved
.github/workflows/integ-tests-with-security.yml Outdated Show resolved Hide resolved
.github/workflows/integ-tests-with-security.yml Outdated Show resolved Hide resolved
integ-test/build.gradle Outdated Show resolved Hide resolved
setting 'plugins.security.ssl.transport.enforce_hostname_verification', 'false'
// https is disabled, because `OpenSearchCluster` is hardcoded to validate cluster health by http
// refer how IT framework implemented in security plugin and reuse/copy to activate https
setting 'plugins.security.ssl.http.enabled', 'false'

Choose a reason for hiding this comment

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

This issue was raised because Release testing runs IT tests with the security plugin. If we can catch errors early, we can avoid blocking release.

Yury-Fridlyand and others added 11 commits August 14, 2023 18:05
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
integ-test/build.gradle Outdated Show resolved Hide resolved
integ-test/build.gradle Show resolved Hide resolved
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@Bit-Quill Bit-Quill deleted a comment from codecov bot Aug 17, 2023
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Merging #335 (a618be8) into integ-IT-with-security (e377cf2) will not change coverage.
The diff coverage is n/a.

@@                    Coverage Diff                    @@
##             integ-IT-with-security     #335   +/-   ##
=========================================================
  Coverage                     97.51%   97.51%           
  Complexity                     4657     4657           
=========================================================
  Files                           408      408           
  Lines                         11933    11933           
  Branches                        829      829           
=========================================================
  Hits                          11637    11637           
  Misses                          289      289           
  Partials                          7        7           
Flag Coverage Δ
sql-engine 97.51% <ø> (ø)

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

@Yury-Fridlyand Yury-Fridlyand merged commit f99d895 into integ-IT-with-security Aug 17, 2023
32 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the dev-IT-with-security branch August 17, 2023 23:28
MitchellGale pushed a commit that referenced this pull request Aug 21, 2023
* Run IT tests with security plugin (#335)

* Add extra IT flow.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Remove unneeded files.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Typo fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Fix GHA matrix syntax.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Fix GHA matrix syntax.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Code clean up.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Optimize downloading.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Apply suggestions from code review

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>

* Update integ-test/build.gradle

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>

* Typo fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Rework implementation.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR review.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR feedback + some fixes.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>

* Minor fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR feedback.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Typo fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
Yury-Fridlyand added a commit that referenced this pull request Aug 23, 2023
* Run IT tests with security plugin (#335)

* Add extra IT flow.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Remove unneeded files.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Typo fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Fix GHA matrix syntax.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Fix GHA matrix syntax.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Code clean up.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Optimize downloading.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Apply suggestions from code review

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>

* Update integ-test/build.gradle

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>

* Typo fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Rework implementation.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR review.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR feedback + some fixes.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>

* Minor fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Address PR feedback.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

* Typo fix.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>

---------

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
(cherry picked from commit 7e3a718)
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
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