Skip to content

Commit

Permalink
Only test local transport since GH not by default support ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jun 7, 2024
1 parent d660f83 commit 8bffb31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
4 changes: 2 additions & 2 deletions tests/test_cli_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
29 changes: 2 additions & 27 deletions tests/test_cli_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 8bffb31

Please sign in to comment.