diff --git a/pkgs/clan-cli/clan_cli/debug.py b/pkgs/clan-cli/clan_cli/debug.py index bc5f43b79..9fb9f73f8 100644 --- a/pkgs/clan-cli/clan_cli/debug.py +++ b/pkgs/clan-cli/clan_cli/debug.py @@ -21,14 +21,11 @@ def command_exec(cmd: List[str], work_dir: Path, env: Dict[str, str]) -> None: def block_for_input() -> None: log = logging.getLogger(__name__) procid = os.getpid() - command = f"echo 'continue' > /sys/proc/{procid}/fd/{sys.stdin.fileno()}" + f"echo 'continue' > /sys/proc/{procid}/fd/{sys.stdin.fileno()}" while True: log.warning("Use sudo cntr attach to attach to the container.") - log.warning("Resume execution by executing '%s' in cntr shell", command) - res = input("Input 'continue' to resume execution: ") - if res == "continue": - break + # log.warning("Resume execution by executing '%s' in cntr shell", command) time.sleep(1) log.info("Resuming execution.") diff --git a/pkgs/clan-cli/tests/test_create_flake.py b/pkgs/clan-cli/tests/test_create_flake.py index 0de4e177f..8cacf12f0 100644 --- a/pkgs/clan-cli/tests/test_create_flake.py +++ b/pkgs/clan-cli/tests/test_create_flake.py @@ -25,7 +25,7 @@ def test_create_flake_api( response = api.post( "/api/flake/create", json=dict( - dest=str(flake_dir), + flake_name=str(flake_dir), url=str(DEFAULT_URL), ), ) diff --git a/pkgs/clan-cli/tests/test_flake_api.py b/pkgs/clan-cli/tests/test_flake_api.py index 92cb85daa..c5af63765 100644 --- a/pkgs/clan-cli/tests/test_flake_api.py +++ b/pkgs/clan-cli/tests/test_flake_api.py @@ -1,44 +1,13 @@ import json import logging -from pathlib import Path import pytest from api import TestClient from fixtures_flakes import FlakeForTest -from clan_cli.flakes.create import DEFAULT_URL - log = logging.getLogger(__name__) -@pytest.mark.impure -def test_flake_create(api: TestClient, temporary_home: Path) -> None: - params = {"flake_name": "defaultFlake", "url": str(DEFAULT_URL)} - response = api.post( - "/api/flake/create", - json=params, - ) - - response.json() - assert response.status_code == 201, "Failed to create flake" - - -# @pytest.mark.impure -# def test_flake_create_fail(api: TestClient, temporary_home: Path) -> None: -# params = { -# "flake_name": "../../../defaultFlake/", -# "url": str(DEFAULT_URL) -# } -# response = api.post( -# "/api/flake/create", -# json=params, -# ) - -# data = response.json() -# log.debug("Data: %s", data) -# assert response.status_code == 422, "This should have failed" - - @pytest.mark.impure def test_inspect_ok(api: TestClient, test_flake_with_core: FlakeForTest) -> None: params = {"url": str(test_flake_with_core.path)} diff --git a/pkgs/clan-cli/tests/test_webui.py b/pkgs/clan-cli/tests/test_webui.py index b17ec580e..0ab1c709b 100644 --- a/pkgs/clan-cli/tests/test_webui.py +++ b/pkgs/clan-cli/tests/test_webui.py @@ -5,13 +5,12 @@ import subprocess import sys from pathlib import Path +import pytest from cli import Cli from ports import PortFunction -from clan_cli.debug import breakpoint_container - -# @pytest.mark.timeout(10) +@pytest.mark.timeout(10) def test_start_server(unused_tcp_port: PortFunction, temporary_home: Path) -> None: Cli() port = unused_tcp_port() @@ -38,15 +37,16 @@ echo "1" > {fifo} env["PATH"] = f"{temporary_home}:{env['PATH']}" # Add build/src to PYTHONPATH so that the webui module is found in nix sandbox + # TODO: We need a way to make sure things which work in the devshell also work in the sandbox python_path = env.get("PYTHONPATH") if python_path: env["PYTHONPATH"] = f"/build/src:{python_path}" - breakpoint_container( - cmd=[sys.executable, "-m", "clan_cli.webui", "--port", str(port)], - env=env, - work_dir=temporary_home, - ) + # breakpoint_container( + # cmd=[sys.executable, "-m", "clan_cli.webui", "--port", str(port)], + # env=env, + # work_dir=temporary_home, + # ) with subprocess.Popen( [sys.executable, "-m", "clan_cli.webui", "--port", str(port)],