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 rpm support for integTest framework #1992

Conversation

peterzhuamazon
Copy link
Member

Signed-off-by: Peter Zhu [email protected]

Description

Add rpm support for integTest framework

Issues Resolved

#1951

Check List

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

@peterzhuamazon peterzhuamazon requested a review from a team as a code owner April 19, 2022 03:16
@peterzhuamazon peterzhuamazon self-assigned this Apr 19, 2022
@peterzhuamazon peterzhuamazon linked an issue Apr 19, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Apr 19, 2022

Codecov Report

Merging #1992 (a3bc958) into main (7c732e9) will increase coverage by 5.58%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##               main     #1992      +/-   ##
=============================================
+ Coverage     94.41%   100.00%   +5.58%     
=============================================
  Files           187         6     -181     
  Lines          3739       105    -3634     
  Branches         29        19      -10     
=============================================
- Hits           3530       105    -3425     
+ Misses          203         0     -203     
+ Partials          6         0       -6     
Impacted Files Coverage Δ
src/system/process.py
src/test_workflow/integ_test/local_test_cluster.py
...g_test/local_test_cluster_opensearch_dashboards.py
src/test_workflow/integ_test/service.py
src/test_workflow/integ_test/service_opensearch.py
...rkflow/integ_test/service_opensearch_dashboards.py
src/test_workflow/perf_test/perf_test_runner.py
src/assemble_workflow/bundle_url_location.py
src/git/git_repository.py
src/system/os.py
... and 171 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c732e9...a3bc958. Read the comment docs.

Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Signed-off-by: Peter Zhu <[email protected]>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This PR bolts the changes about specifics on OpenSearch distributions all the way down in base classes that are reusable and generic. Refactor this out into child classes and get rid of all the if's.

@@ -12,12 +12,14 @@


class Process:
def __init__(self) -> None:
def __init__(self, filename: str, distribution: str) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Process is a generic class in system, it should have nothing to do with distribution, this doesn't belong here.

@@ -65,6 +67,10 @@ def terminate(self) -> int:
self.return_code = self.process.returncode
self.process = None

if self.distribution == "rpm":
Copy link
Member

Choose a reason for hiding this comment

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

This should not live in Process.

self.security_enabled = security_enabled
self.additional_config = additional_config
self.dependency_installer = dependency_installer

self.process_handler = Process()
self.process_handler = Process(self.filename, self.distribution)
Copy link
Member

Choose a reason for hiding this comment

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

This class is a generic Service. Subclass it into ServiceOpenSearchTar and ServiceOpenSearchRpm, ServiceOpenSearchDashboardsTar etc., and implement the differences in the child classes.

logging.info(f"Unpacked {bundle_name}")
logging.info(f"Installing {bundle_name} in {self.install_dir}")

if self.distribution == "tar":
Copy link
Member

Choose a reason for hiding this comment

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

Subclass ServiceOpenSearch into ServiceOpenSearchTar and ``ServiceOpenSearchRpm` and implement the differences there.

@peterzhuamazon
Copy link
Member Author

Replaced by #2000.

After talking to @dblock I will re-write this PR so proper functions will be sourced from corresponding classes.

Thanks.

@peterzhuamazon peterzhuamazon deleted the opensearch-integTest-passing branch April 19, 2022 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate integ test using RPM bundle.
3 participants