-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
externalbackend: add kubernetes_job_timeout parameter
- Loading branch information
Vladyslav Moisieienkov
committed
Dec 20, 2021
1 parent
601477f
commit ac194f6
Showing
3 changed files
with
71 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# This file is part of REANA. | ||
# Copyright (C) 2021 CERN. | ||
# | ||
# REANA is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""REANA-Workflow-Engine-Yadage ExternalBackend tests.""" | ||
|
||
from typing import List, Dict, Any, Union | ||
|
||
import pytest | ||
|
||
|
||
class TestExternalBackend: | ||
@pytest.mark.parametrize( | ||
"input_parameters,final_parameters", | ||
[ | ||
( | ||
[ | ||
{"compute_backend": "kubernetes"}, | ||
{"not_exists": "value"}, | ||
{"kubernetes_job_timeout": 20}, | ||
{"kubernetes_memory_limit": None}, | ||
], | ||
{"compute_backend": "kubernetes", "kubernetes_job_timeout": 20}, | ||
), | ||
( | ||
[{"kubernetes_job_timeout": 10}, {"kubernetes_job_timeout": 30}], | ||
{"kubernetes_job_timeout": 30}, | ||
), | ||
], | ||
) | ||
def test_get_resources( | ||
self, input_parameters: List[Union[Dict, Any]], final_parameters: Dict[str, Any] | ||
): | ||
from reana_workflow_engine_yadage.externalbackend import ExternalBackend | ||
|
||
assert ExternalBackend._get_resources(input_parameters) == final_parameters |