diff --git a/.tests/ci-test-run.sh b/.tests/ci-test-run.sh index 941825b7..ea13df35 100755 --- a/.tests/ci-test-run.sh +++ b/.tests/ci-test-run.sh @@ -8,6 +8,8 @@ set -e "$dp0/test-tools.sh" || exit 1 -cd "$dp0/../_AutoinstallCreator" && python3 -m unittest || exit 1 +if [[ "$is_windows_os" == true ]]; then + cd "$dp0/../_AutoinstallCreator" && python3 -m unittest || exit 1 +fi "$dp0/test-run.sh" -- testInternalCreate || exit 1 diff --git a/_AutoinstallCreator/test_update.py b/_AutoinstallCreator/test_update.py index 0d085d5d..69b3f968 100644 --- a/_AutoinstallCreator/test_update.py +++ b/_AutoinstallCreator/test_update.py @@ -11,11 +11,11 @@ _root_path: str = os.path.dirname(_self_path) _tools_path: str = os.path.join(_root_path, '.tools') -busybox_exe_path: str = 'busybox' +busybox_exe_path_arg: list[str] = [] update_script_name: str = 'update.sh' package_name = 'AutoinstallCreator.sh' if sys.platform.startswith('win'): - busybox_exe_path = os.path.join(_tools_path, 'busybox.exe') + busybox_exe_path_arg = [os.path.join(_tools_path, 'busybox.exe')] update_script_name = 'update.bat' package_name = 'AutoinstallCreator.sh.bat' @@ -45,7 +45,7 @@ def setUpClass(cls) -> None: pathlib.Path(os.path.join(_self_path, 'AutoinstallCreator.sh')).unlink(missing_ok=True) pathlib.Path(os.path.join(_self_path, 'AutoinstallCreator.sh.bat')).unlink(missing_ok=True) - result = subprocess.run(['bash', os.path.join(_self_path, 'release.sh')], + result = subprocess.run(busybox_exe_path_arg + ['bash', os.path.join(_self_path, 'release.sh')], check=True, stdout=subprocess.PIPE) cls.version_str = get_version_from_stdout(result.stdout) @@ -57,9 +57,9 @@ def setUp(self): shutil.copyfile(os.path.join(_self_path, package_name), self.package_filepath) def test_version_up_to_date(self): - subprocess.run(['bash', self.package_filepath], cwd=_self_tmp_path) + subprocess.run(busybox_exe_path_arg + ['bash', self.package_filepath], cwd=_self_tmp_path) - result = subprocess.run(['bash', os.path.join(_self_tmp_path, self.version_str, 'update.sh')], + result = subprocess.run(busybox_exe_path_arg + ['bash', os.path.join(_self_tmp_path, self.version_str, 'update.sh')], env={ **os.environ, 'MOCK_AUTOINSTALLCREATOR_VERSION_BODY': self.version_str, @@ -69,7 +69,7 @@ def test_version_up_to_date(self): self.assertTrue(result.stdout.endswith(b'\nVersion is up to date\n')) def test_update_to_new_version(self): - subprocess.run(['bash', self.package_filepath, '--target', self.test_old_version], + subprocess.run(busybox_exe_path_arg + ['bash', self.package_filepath, '--target', self.test_old_version], cwd=_self_tmp_path) io_tools.write_text(os.path.join(_self_tmp_path, self.test_old_version, '_AutoinstallCreator', 'version.txt'),