From 2cfabba6c7b6d5d4409bdc4c189a6a49d34016db Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Fri, 7 Jun 2024 22:23:07 +0200 Subject: [PATCH] Only test local transport since GH not by default support ssh --- .github/workflows/ci.yml | 4 ++-- tests/test_cli_install.py | 4 ++-- tests/test_cli_server.py | 29 ++--------------------------- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15ed207..f89a89c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Install python dependencies run: | pip install --upgrade pip - pip install -e .[tests] + pip install .[tests] - name: Run test suite run: | @@ -41,6 +41,6 @@ jobs: - name: Install python dependencies run: | pip install --upgrade pip - pip install -e .[docs] + pip install .[docs] - name: Build docs run: cd docs && make diff --git a/tests/test_cli_install.py b/tests/test_cli_install.py index 6ed4a87..25b7c93 100644 --- a/tests/test_cli_install.py +++ b/tests/test_cli_install.py @@ -10,8 +10,8 @@ def runner(): return CliRunner() -def test_install(runner, tmp_path, aiida_computer_ssh): - aiida_computer_ssh(label="localhost-hq") +def test_install(runner, tmp_path, aiida_computer_local): + aiida_computer_local(label="localhost-hq") version = "0.19.0" result = runner.invoke( diff --git a/tests/test_cli_server.py b/tests/test_cli_server.py index b2d7c1d..1f62fe4 100644 --- a/tests/test_cli_server.py +++ b/tests/test_cli_server.py @@ -97,34 +97,9 @@ def test_server_info_direct( assert "Start date" in result.output -def test_server_info_ssh( - runner: CliRunner, - aiida_computer_ssh, - monkeypatch: pytest.MonkeyPatch, - hq_env_mock_exec_command_wait, - hq_env: HqEnv, -): - """Test server info, test against ssh transport""" - aiida_computer_ssh(label="localhost-hq") - - monkeypatch.setattr( - TransportClass, "exec_command_wait", hq_env_mock_exec_command_wait - ) - - result = runner.invoke(cmd_info, "localhost-hq") - assert result.exit_code == 1 - assert "Critical: cannot obtain HyperQueue server information" in result.output - - hq_env.start_server() - result = runner.invoke(cmd_info, "localhost-hq") - - assert result.exit_code == 0 - assert "Start date" in result.output - - def test_server_start_info_stop_circle( runner: CliRunner, - aiida_computer_ssh, + aiida_computer_local, monkeypatch: pytest.MonkeyPatch, hq_env_mock_exec_command_wait, server_dir_mock_exec_command_wait, @@ -136,7 +111,7 @@ def test_server_start_info_stop_circle( to clean the files and process. Therefor, it may cause problem that the process are left not cleaned. """ - aiida_computer_ssh(label="localhost-hq") + aiida_computer_local(label="localhost-hq") monkeypatch.setattr( TransportClass, "exec_command_wait", server_dir_mock_exec_command_wait