Skip to content

Commit 182fb99

Browse files
authored
remove jdk install in favour of using ansible
1 parent 4a32851 commit 182fb99

File tree

4 files changed

+0
-96
lines changed

4 files changed

+0
-96
lines changed

installation_and_upgrade/ibex_install_utils/install_tasks.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def run_instrument_install(self) -> None:
168168

169169
self._system_tasks.check_resources()
170170
self._system_tasks.install_or_upgrade_git()
171-
self._system_tasks.check_java_installation()
172171

173172
self._system_tasks.restrict_ie()
174173

@@ -231,7 +230,6 @@ def run_instrument_deploy_main(self) -> None:
231230
Current the server can not be started or stopped in this python script.
232231
"""
233232
self._system_tasks.install_or_upgrade_git()
234-
self._system_tasks.check_java_installation()
235233
self._git_tasks.show_git_status()
236234
self._backup_tasks.backup_old_directories()
237235
self._backup_tasks.backup_checker()
@@ -295,7 +293,6 @@ def run_update_journal_parser(self) -> None:
295293
def run_developer_update(self) -> None:
296294
"""Update all the developer tools to latest version"""
297295
self._mysql_tasks.install_mysql(force=False)
298-
self._system_tasks.check_java_installation()
299296
self._system_tasks.install_or_upgrade_git()
300297
self._system_tasks.update_kafka_topics()
301298
self._system_tasks.create_virtual_envs()

installation_and_upgrade/ibex_install_utils/software_dependency/java.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

installation_and_upgrade/ibex_install_utils/tasks/system_tasks.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from ibex_install_utils.kafka_utils import add_required_topics
1515
from ibex_install_utils.run_process import RunProcess
1616
from ibex_install_utils.software_dependency.git import Git
17-
from ibex_install_utils.software_dependency.java import Java
1817
from ibex_install_utils.task import task
1918
from ibex_install_utils.tasks import BaseTasks
2019
from ibex_install_utils.tasks.common_paths import APPS_BASE_DIR, EPICS_PATH, UV, VAR_DIR
@@ -82,36 +81,6 @@ def clean_up_desktop_ibex_training_folder(self) -> None:
8281
"""
8382
self._file_utils.remove_tree(DESKTOP_TRAINING_FOLDER_PATH, self.prompt)
8483

85-
@version_check(Java())
86-
@task("Install java")
87-
def check_java_installation(self) -> None:
88-
"""
89-
Checks Java installation
90-
"""
91-
installer, _ = Java().find_latest()
92-
93-
if os.path.exists(installer):
94-
print(f"running installer at {installer}")
95-
subprocess.call(
96-
f"msiexec /i {installer} "
97-
"ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome "
98-
'INSTALLDIR="c:\\Program Files\\Eclipse Adoptium\\" /quiet'
99-
)
100-
self.prompt.prompt_and_raise_if_not_yes(
101-
"Make sure java installed correctly.\r\n"
102-
"After following the installer, ensure you close and then re-open"
103-
" your remote desktop session (This "
104-
"is a workaround for windows not immediately picking up new environment variables)"
105-
)
106-
else:
107-
self.prompt.prompt_and_raise_if_not_yes(
108-
"Upgrade openJDK installation by following:\r\n"
109-
"https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/Upgrade-Java\r\n\r\n"
110-
"After following the installer, ensure you close and then re-open"
111-
" your remote desktop session (This "
112-
"is a workaround for windows not immediately picking up new environment variables)"
113-
)
114-
11584
@task("Configure COM ports")
11685
def configure_com_ports(self) -> None:
11786
"""

installation_and_upgrade/ibex_install_utils/tests/test_version_check.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pytest
55
from ibex_install_utils.software_dependency import is_higher
66
from ibex_install_utils.software_dependency.git import Git
7-
from ibex_install_utils.software_dependency.java import Java
87
from ibex_install_utils.version_check import *
98

109

@@ -16,14 +15,6 @@ def get_version_from_name(name):
1615
version = re.search(r"([0-9]+\.[0-9]+(\.[0-9]+)+)", basename).group(1)
1716
return version
1817

19-
20-
MOCK_JAVA_INSTALLERS = [
21-
"OpenJDK_17.0.4.3_1.msi", # latest
22-
"OpenJDK_17.0.1_1.msi",
23-
"OpenJDK_17.0.4_1.msi",
24-
"OpenJDK_16.0.4.6_1.msi",
25-
]
26-
2718
MOCK_GIT_INSTALLERS = [
2819
"Git-2.3.0-1.exe",
2920
"Git-2.3.2-1-bit.exe", # latest
@@ -54,37 +45,6 @@ def test_get_major_minor_patch(self):
5445
with pytest.raises(AttributeError):
5546
get_major_minor_patch("java 17.2.4")
5647

57-
def test_GIVEN_java_latest_WHEN_version_checked_THEN_decorated_function_not_called(self):
58-
javaMock = Java()
59-
60-
javaMock.get_installed_version = Mock(return_value="17.0.4")
61-
javaMock.get_version_of = Mock(side_effect=get_version_from_name)
62-
javaMock.find_available = Mock(return_value=MOCK_JAVA_INSTALLERS)
63-
64-
inner_function = Mock()
65-
66-
@version_check(javaMock)
67-
def function(_):
68-
inner_function()
69-
70-
function(self)
71-
inner_function.assert_not_called()
72-
73-
def test_GIVEN_java_old_WHEN_version_checked_THEN_decorated_function_called(self):
74-
javaMock = Java()
75-
76-
javaMock.get_installed_version = Mock(return_value="17.0.0")
77-
javaMock.get_version_of = Mock(side_effect=get_version_from_name)
78-
javaMock.find_available = Mock(return_value=MOCK_JAVA_INSTALLERS)
79-
80-
functionMock = Mock()
81-
82-
@version_check(javaMock)
83-
def function(_):
84-
functionMock()
85-
86-
function(self)
87-
functionMock.assert_called_once()
8848

8949
def test_GIVEN_git_latest_WHEN_version_checked_THEN_decorated_function_not_called(self):
9050
gitMock = Git()

0 commit comments

Comments
 (0)