def METHOD_NAME(mock_requests, mock_cloud_runtime, mock_cloud_backend, mock_plugin_server, plugin_source, actions):
    """Tests that running a job from a plugin calls the correct `CloudRuntime` methods with the correct
    arguments."""
    content = as_tar_bytes("plugin.py", plugin_source)
    mock_requests.get.side_effect = mock_requests_get("http://test.tar.gz", content)
    body = _Run(
        plugin_entrypoint="plugin.py",
        source_code_url="http://test.tar.gz",
        project_id="test_project_id",
        cloudspace_id="test_cloudspace_id",
        cluster_id="test_cluster_id",
        plugin_arguments={"name": "test_name", "entrypoint": "test_entrypoint"},
        source_app="test_source_app",
    )
    mock_app = mock.MagicMock()
    mock_cloud_runtime.load_app_from_file.return_value = mock_app
    response = mock_plugin_server.post("/v1/runs", json=body.dict(exclude_none=True))
    assert response.status_code == status.HTTP_200_OK
    assert json.loads(response.text)["actions"] == actions
    mock_cloud_runtime.load_app_from_file.assert_called_once()
    assert "test_entrypoint" in mock_cloud_runtime.load_app_from_file.call_args[0][0]
    mock_cloud_runtime.assert_called_once_with(
        app=mock_app,
        entrypoint=Path("test_entrypoint"),
        start_server=True,
        env_vars={},
        secrets={},
        run_app_comment_commands=True,
        backend=mock.ANY,
    )
    mock_cloud_runtime().cloudspace_dispatch.assert_called_once_with(
        project_id=body.project_id,
        cloudspace_id=body.cloudspace_id,
        name="test_name",
        cluster_id=body.cluster_id,
        source_app=body.source_app,
    )