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

Add option for bwc tests in bundle level #652

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

zelinh
Copy link
Member

@zelinh zelinh commented Jan 6, 2023

Description

Add option to run BWC tests in distribution level, which is running tests in the test cluster with latest distribution bundle installed and all plugins (included in the latest manifest) present.

The command to run BWC tests in distribution level would be ./gradlew bwcTestSuite -Dtests.security.manager=false -PcustomDistributionDownloadType=bundle
If property customDistributionDownloadType is not set nor set to bundle, the BWC tests would be default to run in plugins level as previously configured.

Issues Resolved

Part of opensearch-project/opensearch-build#2870

CheckList:

  • 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.

@zelinh zelinh requested a review from a team January 6, 2023 23:46
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2023

Codecov Report

Merging #652 (2f33fb4) into 2.x (25431be) will increase coverage by 0.21%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                2.x     #652      +/-   ##
============================================
+ Coverage     75.48%   75.70%   +0.21%     
- Complexity     2611     2616       +5     
============================================
  Files           330      330              
  Lines         15115    15115              
  Branches       2338     2338              
============================================
+ Hits          11410    11443      +33     
+ Misses         2379     2348      -31     
+ Partials       1326     1324       -2     
Impacted Files Coverage Δ
...nt/indexstatemanagement/model/destination/Chime.kt 55.55% <0.00%> (-22.23%) ⬇️
...arch/indexmanagement/rollup/RollupSearchService.kt 61.11% <0.00%> (-3.71%) ⬇️
...earch/indexmanagement/transform/model/Transform.kt 85.59% <0.00%> (-0.43%) ⬇️
...nt/indexstatemanagement/ManagedIndexCoordinator.kt 70.26% <0.00%> (+0.58%) ⬆️
...nt/rollup/action/stop/TransportStopRollupAction.kt 77.64% <0.00%> (+1.17%) ⬆️
.../rollup/action/start/TransportStartRollupAction.kt 72.94% <0.00%> (+1.17%) ⬆️
...dexmanagement/transform/model/TransformMetadata.kt 92.23% <0.00%> (+2.91%) ⬆️
...gement/indexstatemanagement/action/ShrinkAction.kt 72.05% <0.00%> (+2.94%) ⬆️
...opensearch/indexmanagement/rollup/RollupIndexer.kt 72.72% <0.00%> (+16.66%) ⬆️
...statemanagement/model/destination/CustomWebhook.kt 95.71% <0.00%> (+28.57%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

build.gradle Show resolved Hide resolved
build.gradle Show resolved Hide resolved
build.gradle Show resolved Hide resolved
File getAsFile() {
return fileTree(bwc_js_resource_location).getSingleFile()
if (bwcBundleTest) {
versions = ["1.3.2", bwcCurrentVersion]
Copy link
Member

Choose a reason for hiding this comment

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

get this 1.3.2 from bwcBundleVersion?

Copy link
Member Author

Choose a reason for hiding this comment

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

bwcBundleVersion is actually 4 digits version and this would need to be 3 digits.
Since this would be fixed most of the time as the old version, we don't need to change it every time. We could add another line to derive 3 digits version from bwcBundleVersion if you think that would be better.

Copy link
Member

Choose a reason for hiding this comment

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

Wondering if there's a guide line of the bwc version, for example, on 2.5 branch, should we run bwc against the the latest 1.x version or the last 2.4.x version.
If it's 1.x version, then true we don't change this often I suppose.

build.gradle Outdated
Comment on lines 659 to 682
nodes.each { node ->
node.extraConfigFile("kirk.pem", file("src/test/resources/security/kirk.pem"))
node.extraConfigFile("kirk-key.pem", file("src/test/resources/security/kirk-key.pem"))
node.extraConfigFile("esnode.pem", file("src/test/resources/security/esnode.pem"))
node.extraConfigFile("esnode-key.pem", file("src/test/resources/security/esnode-key.pem"))
node.extraConfigFile("root-ca.pem", file("src/test/resources/security/root-ca.pem"))
node.setting("plugins.security.disabled", "true")
node.setting("plugins.security.ssl.transport.pemcert_filepath", "esnode.pem")
node.setting("plugins.security.ssl.transport.pemkey_filepath", "esnode-key.pem")
node.setting("plugins.security.ssl.transport.pemtrustedcas_filepath", "root-ca.pem")
node.setting("plugins.security.ssl.transport.enforce_hostname_verification", "false")
node.setting("plugins.security.ssl.http.enabled", "true")
node.setting("plugins.security.ssl.http.pemcert_filepath", "esnode.pem")
node.setting("plugins.security.ssl.http.pemkey_filepath", "esnode-key.pem")
node.setting("plugins.security.ssl.http.pemtrustedcas_filepath", "root-ca.pem")
node.setting("plugins.security.allow_unsafe_democertificates", "true")
node.setting("plugins.security.allow_default_init_securityindex", "true")
node.setting("plugins.security.authcz.admin_dn", "CN=kirk,OU=client,O=client,L=test,C=de")
node.setting("plugins.security.audit.type", "internal_elasticsearch")
node.setting("plugins.security.enable_snapshot_restore_privilege", "true")
node.setting("plugins.security.check_snapshot_restore_write_privileges", "true")
node.setting("plugins.security.restapi.roles_enabled", "[\"all_access\", \"security_rest_api_access\"]")
node.setting("plugins.security.system_indices.enabled", "true")
}
Copy link
Member

Choose a reason for hiding this comment

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

See if you can move this to where you set up the test cluster using bundle

Copy link
Member Author

Choose a reason for hiding this comment

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

This won't be applicable at this time because as far as i see we want to make the framework itself more generic. This codebase is actually derived from security repo on running bwc tests. It works as parameter to add certificates to the test cluster.

build.gradle Outdated Show resolved Hide resolved
Signed-off-by: Zelin Hao <[email protected]>
@bowenlan-amzn bowenlan-amzn merged commit 94c48e9 into opensearch-project:2.x Jan 10, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 10, 2023
* Add option for bwc tests in bundle level

Signed-off-by: Zelin Hao <[email protected]>

* Fix bug for security

Signed-off-by: Zelin Hao <[email protected]>

Signed-off-by: Zelin Hao <[email protected]>
(cherry picked from commit 94c48e9)
@zelinh zelinh added v2.5.0 'Issues and PRs related to version v2.5.0' and removed backport 2.5 labels Jan 10, 2023
zelinh added a commit that referenced this pull request Jan 10, 2023
* Add option for bwc tests in bundle level

Signed-off-by: Zelin Hao <[email protected]>

* Fix bug for security

Signed-off-by: Zelin Hao <[email protected]>

Signed-off-by: Zelin Hao <[email protected]>
(cherry picked from commit 94c48e9)
Signed-off-by: Zelin Hao <[email protected]>
bowenlan-amzn pushed a commit that referenced this pull request Jan 10, 2023
* Add option for bwc tests in bundle level

Signed-off-by: Zelin Hao <[email protected]>

* Fix bug for security

Signed-off-by: Zelin Hao <[email protected]>

Signed-off-by: Zelin Hao <[email protected]>
(cherry picked from commit 94c48e9)
Signed-off-by: Zelin Hao <[email protected]>

Signed-off-by: Zelin Hao <[email protected]>
Co-authored-by: Zelin Hao <[email protected]>
wuychn pushed a commit to ochprince/index-management that referenced this pull request Mar 16, 2023
* Add option for bwc tests in bundle level

Signed-off-by: Zelin Hao <[email protected]>

* Fix bug for security

Signed-off-by: Zelin Hao <[email protected]>

Signed-off-by: Zelin Hao <[email protected]>
ronnaksaxena pushed a commit to ronnaksaxena/index-management that referenced this pull request Jul 19, 2023
* Add option for bwc tests in bundle level

Signed-off-by: Zelin Hao <[email protected]>

* Fix bug for security

Signed-off-by: Zelin Hao <[email protected]>

Signed-off-by: Zelin Hao <[email protected]>
Signed-off-by: Ronnak Saxena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.5.0 'Issues and PRs related to version v2.5.0'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants