diff --git a/src/gha_runner/clouddeployment.py b/src/gha_runner/clouddeployment.py index 40d8f1c..e83ff87 100644 --- a/src/gha_runner/clouddeployment.py +++ b/src/gha_runner/clouddeployment.py @@ -147,8 +147,9 @@ def __post_init__(self): # We need to create runner tokens for use by the provider runner_tokens = self.gh.create_runner_tokens(self.count) self.cloud_params["gh_runner_tokens"] = runner_tokens + architecture = self.cloud_params.get("arch", "x64") release = self.gh.get_latest_runner_release( - platform="linux", architecture="x64" + platform="linux", architecture=architecture ) self.cloud_params["runner_release"] = release self.provider = self.provider_type(**self.cloud_params) diff --git a/tests/test_clouddeployment.py b/tests/test_clouddeployment.py index 65af140..4d19e6e 100644 --- a/tests/test_clouddeployment.py +++ b/tests/test_clouddeployment.py @@ -36,6 +36,7 @@ def get_instance_mapping(self): def wait_until_removed(self, ids, **kwargs): pass + class MockFailableWaitStop(StopCloudInstance): def __init__(self): self.instances = {"i-123": "runner-1"} @@ -73,7 +74,9 @@ def deploy_instance(gh_mock): def test_deploy_instance_creation(deploy_instance, gh_mock): assert isinstance(deploy_instance.provider, MockStartCloudInstance) gh_mock.create_runner_tokens.assert_called_once_with(1) - gh_mock.get_latest_runner_release.assert_called_once() + gh_mock.get_latest_runner_release.assert_called_once_with( + platform="linux", architecture="x64" + ) def test_deploy_instance_start_runners(deploy_instance, gh_mock): @@ -127,17 +130,19 @@ def test_teardown_instance_failure(gh_mock, capsys): teardown.stop_runner_instances() captured = capsys.readouterr() catpured_output = captured.out - expected_output = ["Shutting down...", + expected_output = [ + "Shutting down...", "Removing GitHub Actions Runner", "Removing runner runner-1", "::warning title=Failed to remove runner::Testing", "Removing instances...", "Waiting for instance to be removed...", - "Instances removed!" + "Instances removed!", ] actual_output = catpured_output.strip().split("\n") assert actual_output == expected_output + def test_teardown_instance_failed_wait(gh_mock, capsys): with pytest.raises(SystemExit) as exit_info: teardown = TeardownInstance(