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 Jul 17, 2024
1 parent 01d853d commit 2cfabba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
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 2cfabba

Please sign in to comment.