From e9037e09d281a4a86abb50385ad0dea2620b561c Mon Sep 17 00:00:00 2001 From: Adam Chidlow Date: Fri, 16 Dec 2022 16:04:38 +0800 Subject: [PATCH] feat(doctor): use sys.version for fuller output (vs version_info tuple) feat(doctor): use platform.platform() for more complete OS details refactor(doctor,sandbox): move common docker compose version functionality out + other minor refactorings --- src/algokit/cli/doctor.py | 34 ++-- src/algokit/cli/sandbox.py | 38 +++-- src/algokit/core/doctor.py | 54 ++---- src/algokit/core/sandbox.py | 26 +++ src/algokit/core/utils.py | 10 ++ tests/doctor/test_doctor.py | 155 ++++++------------ ...est_doctor_all_failed[linux].approved.txt} | 12 +- ...est_doctor_all_failed[macOS].approved.txt} | 18 +- ...t_doctor_all_failed[windows].approved.txt} | 18 +- ...doctor.test_doctor_successful.approved.txt | 0 ...est_doctor_successful[linux].approved.txt} | 6 +- ...est_doctor_successful[macOS].approved.txt} | 14 +- ...t_doctor_successful[windows].approved.txt} | 14 +- ..._doctor.test_doctor_with_copy.approved.txt | 14 +- ...r_with_docker_compose_warning.approved.txt | 16 +- ...octor_with_git_warning_on_mac.approved.txt | 14 +- ...r_with_git_warning_on_windows.approved.txt | 14 +- ...ctor_with_weird_values_on_mac.approved.txt | 12 +- ..._with_weird_values_on_windows.approved.txt | 14 +- ...seable_docker_compose_version.approved.txt | 2 +- 20 files changed, 219 insertions(+), 266 deletions(-) create mode 100644 src/algokit/core/utils.py rename tests/doctor/{test_doctor.test_doctor_all_failed_on_linux.approved.txt => test_doctor.test_doctor_all_failed[linux].approved.txt} (84%) rename tests/doctor/{test_doctor.test_doctor_all_failed_on_mac.approved.txt => test_doctor.test_doctor_all_failed[macOS].approved.txt} (85%) rename tests/doctor/{test_doctor.test_doctor_all_failed_on_windows.approved.txt => test_doctor.test_doctor_all_failed[windows].approved.txt} (86%) create mode 100644 tests/doctor/test_doctor.test_doctor_successful.approved.txt rename tests/doctor/{test_doctor.test_doctor_successful_on_linux.approved.txt => test_doctor.test_doctor_successful[linux].approved.txt} (92%) rename tests/doctor/{test_doctor.test_doctor_successful_on_mac.approved.txt => test_doctor.test_doctor_successful[macOS].approved.txt} (92%) rename tests/doctor/{test_doctor.test_doctor_successful_on_windows.approved.txt => test_doctor.test_doctor_successful[windows].approved.txt} (92%) diff --git a/src/algokit/cli/doctor.py b/src/algokit/cli/doctor.py index 54b18c7c4..9745f9482 100644 --- a/src/algokit/cli/doctor.py +++ b/src/algokit/cli/doctor.py @@ -4,7 +4,6 @@ import click import pyclip # type: ignore from algokit.core import doctor as doctor_functions -from algokit.core.doctor import ProcessResult logger = logging.getLogger(__name__) DOCTOR_END_MESSAGE = ( @@ -29,27 +28,27 @@ default=False, ) def doctor_command(*, copy_to_clipboard: bool) -> None: - return_code = 0 os_type = platform.system().lower() - service_outputs: dict[str, ProcessResult] = {} + service_outputs = { + "Time": doctor_functions.get_date(), + "AlgoKit": doctor_functions.get_algokit_info(), + "OS": doctor_functions.get_os(), + "Docker": doctor_functions.get_docker_info(), + "Docker Compose": doctor_functions.get_docker_compose_info(), + "Git": doctor_functions.get_git_info(os_type), + "AlgoKit Python": doctor_functions.get_algokit_python_info(), + "Global Python": doctor_functions.get_global_python_info("python"), + "Global Python3": doctor_functions.get_global_python_info("python3"), + "Pipx": doctor_functions.get_pipx_info(), + "Poetry": doctor_functions.get_poetry_info(), + "Node.js": doctor_functions.get_node_info(), + "Npm": doctor_functions.get_npm_info(os_type), + } - service_outputs["Time"] = doctor_functions.get_date() - service_outputs["AlgoKit"] = doctor_functions.get_algokit_info() if os_type == "windows": service_outputs["Chocolatey"] = doctor_functions.get_choco_info() if os_type == "darwin": service_outputs["Brew"] = doctor_functions.get_brew_info() - service_outputs["OS"] = doctor_functions.get_os(os_type) - service_outputs["Docker"] = doctor_functions.get_docker_info() - service_outputs["Docker Compose"] = doctor_functions.get_docker_compose_info() - service_outputs["Git"] = doctor_functions.get_git_info(os_type) - service_outputs["AlgoKit Python"] = doctor_functions.get_algokit_python_info() - service_outputs["Global Python"] = doctor_functions.get_global_python_info("python") - service_outputs["Global Python3"] = doctor_functions.get_global_python_info("python3") - service_outputs["Pipx"] = doctor_functions.get_pipx_info() - service_outputs["Poetry"] = doctor_functions.get_poetry_info() - service_outputs["Node.js"] = doctor_functions.get_node_info() - service_outputs["Npm"] = doctor_functions.get_npm_info(os_type) critical_services = ["Docker", "Docker Compose", "Git"] # Print the status details @@ -57,7 +56,6 @@ def doctor_command(*, copy_to_clipboard: bool) -> None: color = "green" if value.exit_code != 0: color = "red" if key in critical_services else "yellow" - return_code = 1 logger.info(click.style(f"{key}: ", bold=True) + click.style(f"{value.info}", fg=color)) # print end message anyway @@ -66,5 +64,5 @@ def doctor_command(*, copy_to_clipboard: bool) -> None: if copy_to_clipboard: pyclip.copy("\n".join(f"* {key}: {value.info}" for key, value in service_outputs.items())) - if return_code != 0: + if any(value.exit_code != 0 for value in service_outputs.values()): raise click.exceptions.Exit(code=1) diff --git a/src/algokit/cli/sandbox.py b/src/algokit/cli/sandbox.py index 04bf31d52..db9ce0480 100644 --- a/src/algokit/cli/sandbox.py +++ b/src/algokit/cli/sandbox.py @@ -1,10 +1,18 @@ -import json import logging +from subprocess import CalledProcessError import click from algokit.cli.goal import goal_command from algokit.core import proc -from algokit.core.sandbox import ComposeFileStatus, ComposeSandbox, fetch_algod_status_data, fetch_indexer_status_data +from algokit.core.sandbox import ( + DOCKER_COMPOSE_MINIMUM_VERSION, + ComposeFileStatus, + ComposeSandbox, + fetch_algod_status_data, + fetch_indexer_status_data, + get_docker_compose_version_string, +) +from algokit.core.utils import is_minimum_version logger = logging.getLogger(__name__) @@ -12,13 +20,12 @@ @click.group("sandbox", short_help="Manage the AlgoKit sandbox.") def sandbox_group() -> None: try: - compose_version_result = proc.run( - ["docker", "compose", "version", "--format", "json"], - bad_return_code_error_message=( - "Docker Compose not found; please install Docker Compose and add to path.\n" - "See https://docs.docker.com/compose/install/ for more information." - ), - ) + compose_version_str = get_docker_compose_version_string() or "" + except CalledProcessError as ex: + raise click.ClickException( + "Docker Compose not found; please install Docker Compose and add to path.\n" + "See https://docs.docker.com/compose/install/ for more information." + ) from ex except IOError as ex: # an IOError (such as PermissionError or FileNotFoundError) will only occur if "docker" # isn't an executable in the user's path, which means docker isn't installed @@ -28,20 +35,19 @@ def sandbox_group() -> None: ) from ex else: try: - compose_version: dict[str, str] = json.loads(compose_version_result.output) - compose_version_str = compose_version["version"] - compose_major, compose_minor, *_ = map(int, compose_version_str.lstrip("v").split(".")) + compose_version_ok = is_minimum_version(compose_version_str, DOCKER_COMPOSE_MINIMUM_VERSION) except Exception: logger.warning( "Unable to extract docker compose version from output: \n" - + compose_version_result.output.strip() - + "\nPlease ensure a minimum of compose v2.5.0 is used", + + compose_version_str + + f"\nPlease ensure a minimum of compose v{DOCKER_COMPOSE_MINIMUM_VERSION} is used", exc_info=True, ) else: - if (compose_major, compose_minor) < (2, 5): + if not compose_version_ok: raise click.ClickException( - f"Minimum docker compose version supported: v2.5.0, installed = {compose_version_str}\n" + f"Minimum docker compose version supported: v{DOCKER_COMPOSE_MINIMUM_VERSION}, " + f"installed = v{compose_version_str}\n" "Please update your Docker install" ) diff --git a/src/algokit/core/doctor.py b/src/algokit/core/doctor.py index 7b6124a5f..f7d3bad4e 100644 --- a/src/algokit/core/doctor.py +++ b/src/algokit/core/doctor.py @@ -1,16 +1,17 @@ import dataclasses import logging -import platform -import shutil from datetime import datetime, timezone +from platform import platform as get_platform +from shutil import which from sys import executable as sys_executable -from sys import version_info as sys_version_info +from sys import version as sys_version from algokit.core import proc +from algokit.core.sandbox import DOCKER_COMPOSE_MINIMUM_VERSION, get_docker_compose_version_string +from algokit.core.utils import get_version_from_str, is_minimum_version logger = logging.getLogger(__name__) -DOCKER_COMPOSE_MINIMUM_VERSION = "2.5" DOCKER_COMPOSE_MINIMUM_VERSION_MESSAGE = ( f"\nDocker Compose {DOCKER_COMPOSE_MINIMUM_VERSION} required to `run algokit sandbox command`; " @@ -25,7 +26,7 @@ class ProcessResult: def get_date() -> ProcessResult: - return ProcessResult(format(datetime.now(timezone.utc).isoformat()), 0) + return ProcessResult(str(datetime.now(timezone.utc).isoformat()), 0) def get_algokit_info() -> ProcessResult: @@ -69,19 +70,8 @@ def get_brew_info() -> ProcessResult: return ProcessResult("None found", 1) -def get_os(os_type: str) -> ProcessResult: - os_version = "" - os_name = "" - if os_type == "windows": - os_name = "Windows" - os_version = platform.win32_ver()[0] - elif os_type == "darwin": - os_name = "Mac OS X" - os_version = platform.mac_ver()[0] - else: - os_name = "Unix/Linux" - os_version = platform.version() - return ProcessResult(f"{os_name} {os_version}", 0) +def get_os() -> ProcessResult: + return ProcessResult(get_platform(), 0) def get_docker_info() -> ProcessResult: @@ -102,8 +92,7 @@ def get_docker_info() -> ProcessResult: def get_docker_compose_info() -> ProcessResult: try: - process_results = proc.run(["docker-compose", "-v"]) - docker_compose_version = process_results.output.splitlines()[0].split(" v")[2] + docker_compose_version = get_docker_compose_version_string() or "" minimum_version_met = is_minimum_version(docker_compose_version, DOCKER_COMPOSE_MINIMUM_VERSION) return ProcessResult( ( @@ -111,7 +100,7 @@ def get_docker_compose_info() -> ProcessResult: if minimum_version_met else f"{docker_compose_version}{DOCKER_COMPOSE_MINIMUM_VERSION_MESSAGE}" ), - process_results.exit_code if minimum_version_met else 1, + 0 if minimum_version_met else 1, ) except Exception as e: logger.debug(f"Getting docker compose version failed: {e}", exc_info=True) @@ -142,14 +131,7 @@ def get_git_info(system: str) -> ProcessResult: def get_algokit_python_info() -> ProcessResult: - try: - return ProcessResult( - f"{sys_version_info.major}.{sys_version_info.minor}.{sys_version_info.micro} (location: {sys_executable})", - 0, - ) - except Exception as e: - logger.debug(f"Getting AlgoKit python version failed: {e}", exc_info=True) - return ProcessResult("None found.", 1) + return ProcessResult(f"{sys_version} (location: {sys_executable})", 0) def get_global_python_info(python_command_name: str) -> ProcessResult: @@ -157,7 +139,7 @@ def get_global_python_info(python_command_name: str) -> ProcessResult: major, minor, build = get_version_from_str( proc.run([python_command_name, "--version"]).output.splitlines()[0].split(" ")[1] ) - global_python3_location = shutil.which(python_command_name) + global_python3_location = which(python_command_name) return ProcessResult(f"{major}.{minor}.{build} (location: {global_python3_location})", 0) except Exception as e: logger.debug(f"Getting python version failed: {e}", exc_info=True) @@ -215,15 +197,3 @@ def get_npm_info(system: str) -> ProcessResult: except Exception as e: logger.debug(f"Getting npm version failed: {e}", exc_info=True) return ProcessResult("None found.", 1) - - -def is_minimum_version(system_version: str, minimum_version: str) -> bool: - system_version_as_tuple = tuple(map(int, (system_version.split(".")))) - minimum_version_as_tuple = tuple(map(int, (minimum_version.split(".")))) - return system_version_as_tuple >= minimum_version_as_tuple - - -def get_version_from_str(version: str) -> tuple[int, int, int]: - # take only the first three parts x.y.z of the version to ignore weird version - major, minor, build = map(int, version.split(".")[:3]) - return major, minor, build diff --git a/src/algokit/core/sandbox.py b/src/algokit/core/sandbox.py index 81bbc77aa..6a1d99b53 100644 --- a/src/algokit/core/sandbox.py +++ b/src/algokit/core/sandbox.py @@ -2,15 +2,20 @@ import json import logging from pathlib import Path +from subprocess import CalledProcessError from typing import Any, cast import httpx +from algokit.core import proc from algokit.core.conf import get_app_config_dir from algokit.core.proc import RunResult, run logger = logging.getLogger(__name__) +DOCKER_COMPOSE_MINIMUM_VERSION = "2.5.0" + + class ComposeFileStatus(enum.Enum): MISSING = enum.auto() UP_TO_DATE = enum.auto() @@ -203,3 +208,24 @@ def fetch_indexer_status_data(service_info: dict[str, Any]) -> dict[str, Any]: except Exception as err: logger.debug(f"Error checking indexer status: {err}", exc_info=True) return {"Status": "Error"} + + +def get_docker_compose_version_string() -> str | None: + # 1. IOError - docker not installed or not on path + # -- handle: don't + # 2. exit code non-zero ... for whatever reason + # -- handle: raise CalledProcessError + # 3. failing to parse output of version string + cmd = ["docker", "compose", "version", "--format", "json"] + compose_version_result = proc.run(cmd) + if compose_version_result.exit_code != 0: + raise CalledProcessError( + returncode=compose_version_result.exit_code, cmd=cmd, output=compose_version_result.output + ) + compose_version: dict[str, str] = json.loads(compose_version_result.output) + try: + compose_version_str = compose_version["version"] + except KeyError: + return None + else: + return compose_version_str.lstrip("v") diff --git a/src/algokit/core/utils.py b/src/algokit/core/utils.py new file mode 100644 index 000000000..296d47b93 --- /dev/null +++ b/src/algokit/core/utils.py @@ -0,0 +1,10 @@ +def is_minimum_version(system_version: str, minimum_version: str) -> bool: + system_version_as_tuple = tuple(map(int, system_version.split("."))) + minimum_version_as_tuple = tuple(map(int, minimum_version.split("."))) + return system_version_as_tuple >= minimum_version_as_tuple + + +def get_version_from_str(version: str) -> tuple[int, int, int]: + # take only the first three parts x.y.z of the version to ignore weird version + major, minor, build = map(int, version.split(".")[:3]) + return major, minor, build diff --git a/tests/doctor/test_doctor.py b/tests/doctor/test_doctor.py index 39a1c5fa7..d3329d2bd 100644 --- a/tests/doctor/test_doctor.py +++ b/tests/doctor/test_doctor.py @@ -4,6 +4,7 @@ import click import pytest +from approvaltests.pytest.py_test_namer import PyTestNamer from approvaltests.scrubbers.scrubbers import Scrubber from pytest_mock import MockerFixture from utils.approvals import TokenScrubber, combine_scrubbers, verify @@ -21,27 +22,25 @@ class VersionInfoType(typing.NamedTuple): serial: int -@pytest.fixture(autouse=True) -def mock_dependencies(mocker: MockerFixture) -> None: +@pytest.fixture() +def mock_dependencies(request: pytest.FixtureRequest, mocker: MockerFixture) -> None: # Mock OS.platform - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "darwin" - # Mock platform - mocked_os = mocker.patch("algokit.core.doctor.platform") - mocked_os.win32_ver.return_value = ("windows_version", "", "", "") - mocked_os.mac_ver.return_value = ("mac_os_version", "", "", "") - mocked_os.version.return_value = "linux_version" + platform_system: str = getattr(request, "param", "Darwin") + + mocker.patch("algokit.core.doctor.get_platform").return_value = f"{platform_system}-other-system-info" + mocker.patch("algokit.cli.doctor.platform").system.return_value = platform_system # Mock datetime - mocked_date = mocker.patch("algokit.core.doctor.datetime") - mocked_date.now.return_value = datetime(1990, 12, 31, 10, 9, 8) + mocker.patch("algokit.core.doctor.datetime").now.return_value = datetime(1990, 12, 31, 10, 9, 8) # Mock shutil - mocked_shutil = mocker.patch("algokit.core.doctor.shutil") - mocked_shutil.which.side_effect = mock_shutil_which + mocker.patch("algokit.core.doctor.which").side_effect = mock_shutil_which # Mock sys - Tuple[int, int, int, str, int] - mocker.patch("algokit.core.doctor.sys_version_info", VersionInfoType(3, 6, 2, "blah", 0)) + mocker.patch("algokit.core.doctor.sys_version", "3.6.2") mocker.patch("algokit.core.doctor.sys_executable", "{current_working_directory}/.venv/bin/python") +DOCKER_COMPOSE_VERSION_CMD = ["docker", "compose", "version", "--format", "json"] + + @pytest.fixture(autouse=True) def mock_happy_values(proc_mock: ProcMock) -> None: proc_mock.set_output(["pipx", "list", "--short"], ["aaa 2.3.4", "algokit 1.2.3", "copier 7.0.1"]) @@ -52,7 +51,7 @@ def mock_happy_values(proc_mock: ProcMock) -> None: proc_mock.set_output(["choco"], ["Chocolatey v0.10.15", "Please run 'choco -?' for help"]) proc_mock.set_output(["brew", "-v"], ["Homebrew 3.6.15", "Homebrew/homebrew-core (blah)"]) proc_mock.set_output(["docker", "-v"], ["Docker version 20.10.21, build baeda1f"]) - proc_mock.set_output(["docker-compose", "-v"], ["Docker Compose version v2.12.2"]) + proc_mock.set_output(DOCKER_COMPOSE_VERSION_CMD, ['{"version": "v2.12.2"}']) proc_mock.set_output(["git", "--version"], ["git version 2.37.1 (Apple Git-137.1)"]) proc_mock.set_output(["python", "--version"], ["Python 3.10.0"]) proc_mock.set_output(["python3", "--version"], ["Python 3.11.0"]) @@ -82,14 +81,14 @@ def make_output_scrubber(**extra_tokens: str) -> Scrubber: ) -def test_doctor_help(mocker: MockerFixture): +def test_doctor_help(mocker: MockerFixture, mock_dependencies: None): result = invoke("doctor -h") assert result.exit_code == 0 verify(result.output) -def test_doctor_with_copy(mocker: MockerFixture): +def test_doctor_with_copy(mocker: MockerFixture, mock_dependencies: None): # Mock pyclip mocked_os = mocker.patch("algokit.cli.doctor.pyclip.copy") result = invoke("doctor -c") @@ -99,33 +98,24 @@ def test_doctor_with_copy(mocker: MockerFixture): verify(result.output, scrubber=make_output_scrubber()) -def test_doctor_successful_on_mac(): - result = invoke("doctor") - - assert result.exit_code == 0 - verify(result.output, scrubber=make_output_scrubber()) - - -def test_doctor_successful_on_windows(mocker: MockerFixture, proc_mock: ProcMock): - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "windows" - result = invoke("doctor") - - assert result.exit_code == 0 - verify(result.output, scrubber=make_output_scrubber()) - - -def test_doctor_successful_on_linux(mocker: MockerFixture, proc_mock: ProcMock): - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "linux" +@pytest.mark.parametrize( + "mock_dependencies", + [ + pytest.param("Windows", id="windows"), + pytest.param("Linux", id="linux"), + pytest.param("Darwin", id="macOS"), + ], + indirect=["mock_dependencies"], +) +def test_doctor_successful(request: pytest.FixtureRequest, mock_dependencies: None): result = invoke("doctor") assert result.exit_code == 0 - verify(result.output, scrubber=make_output_scrubber()) + verify(result.output, scrubber=make_output_scrubber(), namer=PyTestNamer(request)) -def test_doctor_with_docker_compose_warning(proc_mock: ProcMock): - proc_mock.set_output(["docker-compose", "-v"], ["Docker Compose version v2.1.3"]) +def test_doctor_with_docker_compose_warning(proc_mock: ProcMock, mock_dependencies: None): + proc_mock.set_output(DOCKER_COMPOSE_VERSION_CMD, ['{"version": "v2.1.3"}']) result = invoke("doctor") @@ -133,7 +123,7 @@ def test_doctor_with_docker_compose_warning(proc_mock: ProcMock): verify(result.output, scrubber=make_output_scrubber()) -def test_doctor_with_git_warning_on_mac(mocker: MockerFixture, proc_mock: ProcMock): +def test_doctor_with_git_warning_on_mac(mocker: MockerFixture, proc_mock: ProcMock, mock_dependencies: None): proc_mock.set_output(["git", "--version"], ["EMPTY"]) result = invoke("doctor") @@ -142,10 +132,8 @@ def test_doctor_with_git_warning_on_mac(mocker: MockerFixture, proc_mock: ProcMo verify(result.output, scrubber=make_output_scrubber()) -def test_doctor_with_git_warning_on_windows(mocker: MockerFixture, proc_mock: ProcMock): - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "windows" - +@pytest.mark.parametrize("mock_dependencies", [pytest.param("Windows", id="windows")], indirect=["mock_dependencies"]) +def test_doctor_with_git_warning_on_windows(mocker: MockerFixture, proc_mock: ProcMock, mock_dependencies: None): proc_mock.set_output(["git", "--version"], []) result = invoke("doctor") @@ -154,9 +142,19 @@ def test_doctor_with_git_warning_on_windows(mocker: MockerFixture, proc_mock: Pr verify(result.output, scrubber=make_output_scrubber()) -def test_doctor_all_failed_on_mac(mocker: MockerFixture, proc_mock: ProcMock): +@pytest.mark.parametrize( + "mock_dependencies", + [ + pytest.param("Windows", id="windows"), + pytest.param("Linux", id="linux"), + pytest.param("Darwin", id="macOS"), + ], + indirect=["mock_dependencies"], +) +def test_doctor_all_failed( + request: pytest.FixtureRequest, mocker: MockerFixture, proc_mock: ProcMock, mock_dependencies: None +): - mocker.patch("algokit.core.doctor.sys_version_info", "") mocker.patch("algokit.core.doctor.sys_executable", "") proc_mock.set_output(["pipx", "list", "--short"], []) @@ -164,7 +162,7 @@ def test_doctor_all_failed_on_mac(mocker: MockerFixture, proc_mock: ProcMock): proc_mock.set_output(["choco"], []) proc_mock.set_output(["brew", "-v"], []) proc_mock.set_output(["docker", "-v"], []) - proc_mock.set_output(["docker-compose", "-v"], []) + proc_mock.set_output(DOCKER_COMPOSE_VERSION_CMD, ["{}"]) proc_mock.set_output(["git", "--version"], []) proc_mock.set_output(["python", "--version"], []) proc_mock.set_output(["python3", "--version"], []) @@ -172,68 +170,15 @@ def test_doctor_all_failed_on_mac(mocker: MockerFixture, proc_mock: ProcMock): proc_mock.set_output(["poetry", "--version"], []) proc_mock.set_output(["node", "-v"], []) proc_mock.set_output(["npm", "-v"], []) - - result = invoke("doctor") - - assert result.exit_code == 1 - verify(result.output, scrubber=make_output_scrubber()) - - -def test_doctor_all_failed_on_windows(mocker: MockerFixture, proc_mock: ProcMock): - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "windows" - - mocker.patch("algokit.core.doctor.sys_version_info", "") - mocker.patch("algokit.core.doctor.sys_executable", "") - - proc_mock.set_output(["pipx", "list", "--short"], []) - proc_mock.set_output(["pipx", "environment"], []) - proc_mock.set_output(["choco"], []) - proc_mock.set_output(["brew", "-v"], []) - proc_mock.set_output(["docker", "-v"], []) - proc_mock.set_output(["docker-compose", "-v"], []) - proc_mock.set_output(["git", "--version"], []) - proc_mock.set_output(["python", "--version"], []) - proc_mock.set_output(["python3", "--version"], []) - proc_mock.set_output(["pipx", "--version"], []) - proc_mock.set_output(["poetry", "--version"], []) - proc_mock.set_output(["node", "-v"], []) proc_mock.set_output(["npm.cmd", "-v"], []) result = invoke("doctor") assert result.exit_code == 1 - verify(result.output, scrubber=make_output_scrubber()) + verify(result.output, scrubber=make_output_scrubber(), namer=PyTestNamer(request)) -def test_doctor_all_failed_on_linux(mocker: MockerFixture, proc_mock: ProcMock): - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "linux" - - mocker.patch("algokit.core.doctor.sys_version_info", "") - mocker.patch("algokit.core.doctor.sys_executable", "") - - proc_mock.set_output(["pipx", "list", "--short"], []) - proc_mock.set_output(["pipx", "environment"], []) - proc_mock.set_output(["choco"], []) - proc_mock.set_output(["brew", "-v"], []) - proc_mock.set_output(["docker", "-v"], []) - proc_mock.set_output(["docker-compose", "-v"], []) - proc_mock.set_output(["git", "--version"], []) - proc_mock.set_output(["python", "--version"], []) - proc_mock.set_output(["python3", "--version"], []) - proc_mock.set_output(["pipx", "--version"], []) - proc_mock.set_output(["poetry", "--version"], []) - proc_mock.set_output(["node", "-v"], []) - proc_mock.set_output(["npm", "-v"], []) - - result = invoke("doctor") - - assert result.exit_code == 1 - verify(result.output, scrubber=make_output_scrubber()) - - -def test_doctor_with_weird_values_on_mac(mocker: MockerFixture, proc_mock: ProcMock): +def test_doctor_with_weird_values_on_mac(mocker: MockerFixture, proc_mock: ProcMock, mock_dependencies: None): proc_mock.set_output(["brew", "-v"], ["Homebrew 3.6.15-31-g82d89bb"]) result = invoke("doctor") @@ -242,10 +187,8 @@ def test_doctor_with_weird_values_on_mac(mocker: MockerFixture, proc_mock: ProcM verify(result.output, scrubber=make_output_scrubber()) -def test_doctor_with_weird_values_on_windows(mocker: MockerFixture, proc_mock: ProcMock): - mocked_os = mocker.patch("algokit.cli.doctor.platform") - mocked_os.system.return_value = "windows" - +@pytest.mark.parametrize("mock_dependencies", [pytest.param("Windows", id="windows")], indirect=["mock_dependencies"]) +def test_doctor_with_weird_values_on_windows(mocker: MockerFixture, proc_mock: ProcMock, mock_dependencies: None): proc_mock.set_output(["git", "--version"], ["git version 2.31.0.windows.1"]) proc_mock.set_output( ["choco"], ["Chocolatey v0.10.15", "choco: Please run 'choco -?' or 'choco -?' for help menu."] diff --git a/tests/doctor/test_doctor.test_doctor_all_failed_on_linux.approved.txt b/tests/doctor/test_doctor.test_doctor_all_failed[linux].approved.txt similarity index 84% rename from tests/doctor/test_doctor.test_doctor_all_failed_on_linux.approved.txt rename to tests/doctor/test_doctor.test_doctor_all_failed[linux].approved.txt index e2d9f0ff1..f52f47167 100644 --- a/tests/doctor/test_doctor.test_doctor_all_failed_on_linux.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_all_failed[linux].approved.txt @@ -2,11 +2,11 @@ DEBUG: Running 'pipx list --short' in '{current_working_directory}' DEBUG: Getting algokit version failed: list index out of range DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: Getting docker version failed: list index out of range -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: Getting docker compose version failed: list index out of range +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {} +DEBUG: Getting docker compose version failed: invalid literal for int() with base 10: '' DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: Getting git version failed: list index out of range -DEBUG: Getting AlgoKit python version failed: 'str' object has no attribute 'major' DEBUG: Running 'python --version' in '{current_working_directory}' DEBUG: Getting python version failed: list index out of range DEBUG: Running 'python3 --version' in '{current_working_directory}' @@ -21,14 +21,14 @@ DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: Getting npm version failed: list index out of range Time: 1990-12-31T10:09:08 AlgoKit: None found -OS: Unix/Linux linux_version +OS: Linux-other-system-info Docker: None found. Docker required to `run algokit sandbox` command; install via https://docs.docker.com/get-docker/ Docker Compose: None found. -Docker Compose 2.5 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ +Docker Compose 2.5.0 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ Git: None found. Git required to run `algokit init`; install via https://github.com/git-guides/install-git -AlgoKit Python: None found. +AlgoKit Python: 3.6.2 (location: ) Global Python: None found. Global Python3: None found. Pipx: None found. diff --git a/tests/doctor/test_doctor.test_doctor_all_failed_on_mac.approved.txt b/tests/doctor/test_doctor.test_doctor_all_failed[macOS].approved.txt similarity index 85% rename from tests/doctor/test_doctor.test_doctor_all_failed_on_mac.approved.txt rename to tests/doctor/test_doctor.test_doctor_all_failed[macOS].approved.txt index e29e49ec2..d63a1e87f 100644 --- a/tests/doctor/test_doctor.test_doctor_all_failed_on_mac.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_all_failed[macOS].approved.txt @@ -1,14 +1,12 @@ DEBUG: Running 'pipx list --short' in '{current_working_directory}' DEBUG: Getting algokit version failed: list index out of range -DEBUG: Running 'brew -v' in '{current_working_directory}' -DEBUG: Getting brew version failed: list index out of range DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: Getting docker version failed: list index out of range -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: Getting docker compose version failed: list index out of range +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {} +DEBUG: Getting docker compose version failed: invalid literal for int() with base 10: '' DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: Getting git version failed: list index out of range -DEBUG: Getting AlgoKit python version failed: 'str' object has no attribute 'major' DEBUG: Running 'python --version' in '{current_working_directory}' DEBUG: Getting python version failed: list index out of range DEBUG: Running 'python3 --version' in '{current_working_directory}' @@ -21,17 +19,18 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: Getting node version failed: list index out of range DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: Getting npm version failed: list index out of range +DEBUG: Running 'brew -v' in '{current_working_directory}' +DEBUG: Getting brew version failed: list index out of range Time: 1990-12-31T10:09:08 AlgoKit: None found -Brew: None found -OS: Mac OS X mac_os_version +OS: Darwin-other-system-info Docker: None found. Docker required to `run algokit sandbox` command; install via https://docs.docker.com/get-docker/ Docker Compose: None found. -Docker Compose 2.5 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ +Docker Compose 2.5.0 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ Git: None found. Git required to run `algokit init`; install via https://github.com/git-guides/install-git -AlgoKit Python: None found. +AlgoKit Python: 3.6.2 (location: ) Global Python: None found. Global Python3: None found. Pipx: None found. @@ -41,4 +40,5 @@ Poetry is required for some Python-based templates; install via `algokit bootstr Node.js: None found. Node.js is required for some Node.js-based templates; install via `algokit bootstrap` within project directory, or via https://nodejs.dev/en/learn/how-to-install-nodejs/ Npm: None found. +Brew: None found If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_all_failed_on_windows.approved.txt b/tests/doctor/test_doctor.test_doctor_all_failed[windows].approved.txt similarity index 86% rename from tests/doctor/test_doctor.test_doctor_all_failed_on_windows.approved.txt rename to tests/doctor/test_doctor.test_doctor_all_failed[windows].approved.txt index 5816c110d..caf0ec45a 100644 --- a/tests/doctor/test_doctor.test_doctor_all_failed_on_windows.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_all_failed[windows].approved.txt @@ -1,14 +1,12 @@ DEBUG: Running 'pipx list --short' in '{current_working_directory}' DEBUG: Getting algokit version failed: list index out of range -DEBUG: Running 'choco' in '{current_working_directory}' -DEBUG: Getting chocolatey version failed: list index out of range DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: Getting docker version failed: list index out of range -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: Getting docker compose version failed: list index out of range +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {} +DEBUG: Getting docker compose version failed: invalid literal for int() with base 10: '' DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: Getting git version failed: list index out of range -DEBUG: Getting AlgoKit python version failed: 'str' object has no attribute 'major' DEBUG: Running 'python --version' in '{current_working_directory}' DEBUG: Getting python version failed: list index out of range DEBUG: Running 'python3 --version' in '{current_working_directory}' @@ -21,17 +19,18 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: Getting node version failed: list index out of range DEBUG: Running 'npm.cmd -v' in '{current_working_directory}' DEBUG: Getting npm version failed: list index out of range +DEBUG: Running 'choco' in '{current_working_directory}' +DEBUG: Getting chocolatey version failed: list index out of range Time: 1990-12-31T10:09:08 AlgoKit: None found -Chocolatey: None found -OS: Windows windows_version +OS: Windows-other-system-info Docker: None found. Docker required to `run algokit sandbox` command; install via https://docs.docker.com/get-docker/ Docker Compose: None found. -Docker Compose 2.5 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ +Docker Compose 2.5.0 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ Git: None found. Git required to `run algokit init`; install via `choco install git` if using Chocolatey or via https://github.com/git-guides/install-git#install-git-on-windows -AlgoKit Python: None found. +AlgoKit Python: 3.6.2 (location: ) Global Python: None found. Global Python3: None found. Pipx: None found. @@ -41,4 +40,5 @@ Poetry is required for some Python-based templates; install via `algokit bootstr Node.js: None found. Node.js is required for some Node.js-based templates; install via `algokit bootstrap` within project directory, or via https://nodejs.dev/en/learn/how-to-install-nodejs/ Npm: None found. +Chocolatey: None found If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_successful.approved.txt b/tests/doctor/test_doctor.test_doctor_successful.approved.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/doctor/test_doctor.test_doctor_successful_on_linux.approved.txt b/tests/doctor/test_doctor.test_doctor_successful[linux].approved.txt similarity index 92% rename from tests/doctor/test_doctor.test_doctor_successful_on_linux.approved.txt rename to tests/doctor/test_doctor.test_doctor_successful[linux].approved.txt index 6c851fb42..3d1b08085 100644 --- a/tests/doctor/test_doctor.test_doctor_successful_on_linux.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_successful[linux].approved.txt @@ -7,8 +7,8 @@ DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.37.1 (Apple Git-137.1) DEBUG: Running 'python --version' in '{current_working_directory}' @@ -27,7 +27,7 @@ DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: npm: 8.19.2 Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -OS: Unix/Linux linux_version +OS: Linux-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: 2.37.1 diff --git a/tests/doctor/test_doctor.test_doctor_successful_on_mac.approved.txt b/tests/doctor/test_doctor.test_doctor_successful[macOS].approved.txt similarity index 92% rename from tests/doctor/test_doctor.test_doctor_successful_on_mac.approved.txt rename to tests/doctor/test_doctor.test_doctor_successful[macOS].approved.txt index de4da21b6..cdd39ca76 100644 --- a/tests/doctor/test_doctor.test_doctor_successful_on_mac.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_successful[macOS].approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'brew -v' in '{current_working_directory}' -DEBUG: brew: Homebrew 3.6.15 -DEBUG: brew: Homebrew/homebrew-core (blah) DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.37.1 (Apple Git-137.1) DEBUG: Running 'python --version' in '{current_working_directory}' @@ -28,10 +25,12 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: npm: 8.19.2 +DEBUG: Running 'brew -v' in '{current_working_directory}' +DEBUG: brew: Homebrew 3.6.15 +DEBUG: brew: Homebrew/homebrew-core (blah) Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Brew: 3.6.15 -OS: Mac OS X mac_os_version +OS: Darwin-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: 2.37.1 @@ -42,4 +41,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Brew: 3.6.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_successful_on_windows.approved.txt b/tests/doctor/test_doctor.test_doctor_successful[windows].approved.txt similarity index 92% rename from tests/doctor/test_doctor.test_doctor_successful_on_windows.approved.txt rename to tests/doctor/test_doctor.test_doctor_successful[windows].approved.txt index 949455196..6650d575e 100644 --- a/tests/doctor/test_doctor.test_doctor_successful_on_windows.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_successful[windows].approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'choco' in '{current_working_directory}' -DEBUG: choco: Chocolatey v0.10.15 -DEBUG: choco: Please run 'choco -?' for help DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.37.1 (Apple Git-137.1) DEBUG: Running 'python --version' in '{current_working_directory}' @@ -28,10 +25,12 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm.cmd -v' in '{current_working_directory}' DEBUG: npm.cmd: 8.19.2 +DEBUG: Running 'choco' in '{current_working_directory}' +DEBUG: choco: Chocolatey v0.10.15 +DEBUG: choco: Please run 'choco -?' for help Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Chocolatey: 0.10.15 -OS: Windows windows_version +OS: Windows-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: 2.37.1 @@ -42,4 +41,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Chocolatey: 0.10.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_with_copy.approved.txt b/tests/doctor/test_doctor.test_doctor_with_copy.approved.txt index de4da21b6..cdd39ca76 100644 --- a/tests/doctor/test_doctor.test_doctor_with_copy.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_with_copy.approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'brew -v' in '{current_working_directory}' -DEBUG: brew: Homebrew 3.6.15 -DEBUG: brew: Homebrew/homebrew-core (blah) DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.37.1 (Apple Git-137.1) DEBUG: Running 'python --version' in '{current_working_directory}' @@ -28,10 +25,12 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: npm: 8.19.2 +DEBUG: Running 'brew -v' in '{current_working_directory}' +DEBUG: brew: Homebrew 3.6.15 +DEBUG: brew: Homebrew/homebrew-core (blah) Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Brew: 3.6.15 -OS: Mac OS X mac_os_version +OS: Darwin-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: 2.37.1 @@ -42,4 +41,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Brew: 3.6.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_with_docker_compose_warning.approved.txt b/tests/doctor/test_doctor.test_doctor_with_docker_compose_warning.approved.txt index f7ca540d6..bc28d7047 100644 --- a/tests/doctor/test_doctor.test_doctor_with_docker_compose_warning.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_with_docker_compose_warning.approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'brew -v' in '{current_working_directory}' -DEBUG: brew: Homebrew 3.6.15 -DEBUG: brew: Homebrew/homebrew-core (blah) DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.1.3 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.1.3"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.37.1 (Apple Git-137.1) DEBUG: Running 'python --version' in '{current_working_directory}' @@ -28,13 +25,15 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: npm: 8.19.2 +DEBUG: Running 'brew -v' in '{current_working_directory}' +DEBUG: brew: Homebrew 3.6.15 +DEBUG: brew: Homebrew/homebrew-core (blah) Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Brew: 3.6.15 -OS: Mac OS X mac_os_version +OS: Darwin-other-system-info Docker: 20.10.21 Docker Compose: 2.1.3 -Docker Compose 2.5 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ +Docker Compose 2.5.0 required to `run algokit sandbox command`; install via https://docs.docker.com/compose/install/ Git: 2.37.1 AlgoKit Python: 3.6.2 (location: {current_working_directory}/.venv/bin/python) Global Python: 3.10.0 (location: /Library/Frameworks/Python.framework/Versions/3.10/bin/python) @@ -43,4 +42,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Brew: 3.6.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_with_git_warning_on_mac.approved.txt b/tests/doctor/test_doctor.test_doctor_with_git_warning_on_mac.approved.txt index c608ffa2c..a55390c92 100644 --- a/tests/doctor/test_doctor.test_doctor_with_git_warning_on_mac.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_with_git_warning_on_mac.approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'brew -v' in '{current_working_directory}' -DEBUG: brew: Homebrew 3.6.15 -DEBUG: brew: Homebrew/homebrew-core (blah) DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: EMPTY DEBUG: Getting git version failed: list index out of range @@ -29,10 +26,12 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: npm: 8.19.2 +DEBUG: Running 'brew -v' in '{current_working_directory}' +DEBUG: brew: Homebrew 3.6.15 +DEBUG: brew: Homebrew/homebrew-core (blah) Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Brew: 3.6.15 -OS: Mac OS X mac_os_version +OS: Darwin-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: None found. @@ -44,4 +43,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Brew: 3.6.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_with_git_warning_on_windows.approved.txt b/tests/doctor/test_doctor.test_doctor_with_git_warning_on_windows.approved.txt index c9533ca15..0ee9b7070 100644 --- a/tests/doctor/test_doctor.test_doctor_with_git_warning_on_windows.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_with_git_warning_on_windows.approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'choco' in '{current_working_directory}' -DEBUG: choco: Chocolatey v0.10.15 -DEBUG: choco: Please run 'choco -?' for help DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: Getting git version failed: list index out of range DEBUG: Running 'python --version' in '{current_working_directory}' @@ -28,10 +25,12 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm.cmd -v' in '{current_working_directory}' DEBUG: npm.cmd: 8.19.2 +DEBUG: Running 'choco' in '{current_working_directory}' +DEBUG: choco: Chocolatey v0.10.15 +DEBUG: choco: Please run 'choco -?' for help Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Chocolatey: 0.10.15 -OS: Windows windows_version +OS: Windows-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: None found. @@ -43,4 +42,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Chocolatey: 0.10.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_with_weird_values_on_mac.approved.txt b/tests/doctor/test_doctor.test_doctor_with_weird_values_on_mac.approved.txt index c93f55acb..f28525f39 100644 --- a/tests/doctor/test_doctor.test_doctor_with_weird_values_on_mac.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_with_weird_values_on_mac.approved.txt @@ -5,12 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'brew -v' in '{current_working_directory}' -DEBUG: brew: Homebrew 3.6.15-31-g82d89bb DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.37.1 (Apple Git-137.1) DEBUG: Running 'python --version' in '{current_working_directory}' @@ -27,10 +25,11 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm -v' in '{current_working_directory}' DEBUG: npm: 8.19.2 +DEBUG: Running 'brew -v' in '{current_working_directory}' +DEBUG: brew: Homebrew 3.6.15-31-g82d89bb Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Brew: 3.6.15 -OS: Mac OS X mac_os_version +OS: Darwin-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: 2.37.1 @@ -41,4 +40,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 8.19.2 +Brew: 3.6.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/doctor/test_doctor.test_doctor_with_weird_values_on_windows.approved.txt b/tests/doctor/test_doctor.test_doctor_with_weird_values_on_windows.approved.txt index 8c194713a..6032c517a 100644 --- a/tests/doctor/test_doctor.test_doctor_with_weird_values_on_windows.approved.txt +++ b/tests/doctor/test_doctor.test_doctor_with_weird_values_on_windows.approved.txt @@ -5,13 +5,10 @@ DEBUG: pipx: copier 7.0.1 DEBUG: Running 'pipx environment' in '{current_working_directory}' DEBUG: pipx: PIPX_SHARED_LIBS=/pipx/shared DEBUG: pipx: PIPX_LOCAL_VENVS=/pipx/venvs -DEBUG: Running 'choco' in '{current_working_directory}' -DEBUG: choco: Chocolatey v0.10.15 -DEBUG: choco: choco: Please run 'choco -?' or 'choco -?' for help menu. DEBUG: Running 'docker -v' in '{current_working_directory}' DEBUG: docker: Docker version 20.10.21, build baeda1f -DEBUG: Running 'docker-compose -v' in '{current_working_directory}' -DEBUG: docker-compose: Docker Compose version v2.12.2 +DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' +DEBUG: docker: {"version": "v2.12.2"} DEBUG: Running 'git --version' in '{current_working_directory}' DEBUG: git: git version 2.31.0.windows.1 DEBUG: Running 'python --version' in '{current_working_directory}' @@ -28,10 +25,12 @@ DEBUG: Running 'node -v' in '{current_working_directory}' DEBUG: node: v18.12.1 DEBUG: Running 'npm.cmd -v' in '{current_working_directory}' DEBUG: npm.cmd: 16.17.0 +DEBUG: Running 'choco' in '{current_working_directory}' +DEBUG: choco: Chocolatey v0.10.15 +DEBUG: choco: choco: Please run 'choco -?' or 'choco -?' for help menu. Time: 1990-12-31T10:09:08 AlgoKit: 1.2.3 /pipx/venvs/algokit -Chocolatey: 0.10.15 -OS: Windows windows_version +OS: Windows-other-system-info Docker: 20.10.21 Docker Compose: 2.12.2 Git: 2.31.0 @@ -42,4 +41,5 @@ Pipx: 1.1.0 Poetry: 1.2.2 Node.js: 18.12.1 Npm: 16.17.0 +Chocolatey: 0.10.15 If you are experiencing a problem with algokit, feel free to submit an issue via https://github.com/algorandfoundation/algokit-cli/issues/new; please include this output, if you want to populate this message in your clipboard, run `algokit doctor -c` diff --git a/tests/sandbox/test_sandbox_start.test_sandbox_start_with_unparseable_docker_compose_version.approved.txt b/tests/sandbox/test_sandbox_start.test_sandbox_start_with_unparseable_docker_compose_version.approved.txt index 70fed3602..1ecb18ed1 100644 --- a/tests/sandbox/test_sandbox_start.test_sandbox_start_with_unparseable_docker_compose_version.approved.txt +++ b/tests/sandbox/test_sandbox_start.test_sandbox_start_with_unparseable_docker_compose_version.approved.txt @@ -1,7 +1,7 @@ DEBUG: Running 'docker compose version --format json' in '{current_working_directory}' DEBUG: docker: {"version": "v2.5-dev123"} WARNING: Unable to extract docker compose version from output: -{"version": "v2.5-dev123"} +2.5-dev123 Please ensure a minimum of compose v2.5.0 is used DEBUG: Running 'docker version' in '{current_working_directory}' DEBUG: docker: STDOUT