Skip to content

Commit

Permalink
Update fix for the test_cluster to save all local cluster logs
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh committed Jul 27, 2023
2 parents c5c3fb1 + e5e214d commit a885946
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions jenkins/check-for-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pipeline {
}
triggers {
parameterizedCron '''
H 1 * * * %INPUT_MANIFEST=2.9.1/opensearch-2.9.1.yml;TARGET_JOB_NAME=distribution-build-opensearch;BUILD_PLATFORM=linux macos windows;BUILD_DISTRIBUTION=tar rpm deb zip
H 1 * * * %INPUT_MANIFEST=2.10.0/opensearch-dashboards-2.10.0.yml;TARGET_JOB_NAME=distribution-build-opensearch-dashboards;BUILD_PLATFORM=linux windows;BUILD_DISTRIBUTION=tar rpm deb zip
H 1 * * * %INPUT_MANIFEST=2.10.0/opensearch-2.10.0.yml;TARGET_JOB_NAME=distribution-build-opensearch;BUILD_PLATFORM=linux macos windows;BUILD_DISTRIBUTION=tar rpm deb zip
H 1 * * * %INPUT_MANIFEST=1.3.12/opensearch-1.3.12.yml;TARGET_JOB_NAME=distribution-build-opensearch;BUILD_PLATFORM=linux macos windows;BUILD_DISTRIBUTION=tar rpm deb zip
Expand Down
16 changes: 16 additions & 0 deletions manifests/2.9.1/opensearch-2.9.1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
schema-version: '1.0'
build:
name: OpenSearch
version: 2.9.1
ci:
image:
name: opensearchstaging/ci-runner:ci-runner-centos7-opensearch-build-v3
args: -e JAVA_HOME=/opt/java/openjdk-17
components:
- name: OpenSearch
repository: https://github.com/opensearch-project/OpenSearch.git
ref: '2.9'
checks:
- gradle:publish
- gradle:properties:version
3 changes: 1 addition & 2 deletions src/test_workflow/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def start(self) -> None:
def terminate(self) -> None:
if self.service:
self.termination_result = self.service.terminate()
self.__save_test_result_data(self.termination_result)

for service in self.dependencies:
termination_result = service.terminate()
Expand All @@ -92,8 +93,6 @@ def terminate(self) -> None:
if not self.termination_result:
raise ClusterServiceNotInitializedException()

self.__save_test_result_data(self.termination_result)

self.service.uninstall()

def __save_test_result_data(self, termination_result: ServiceTerminationResult) -> None:
Expand Down
9 changes: 8 additions & 1 deletion tests/tests_system/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ def test_terminate_unstarted_process(self) -> None:
def test_terminate_file_process(self, procs: MagicMock, subprocess: MagicMock, process: MagicMock) -> None:
process_handler = Process()

mock_process1 = MagicMock()
mock_process2 = MagicMock()
procs.return_value = [mock_process1, mock_process2]

process_handler.start("mock_command", "mock_cwd")
process_handler.terminate()

procs.assert_called
procs.assert_called()

mock_process1.open_files.assert_called()
mock_process2.open_files.assert_called()

0 comments on commit a885946

Please sign in to comment.