Commit 56eb449b authored by Wout De Nolf's avatar Wout De Nolf
Browse files

ewokscore.tests.examples: API change

parent e04e3725
Pipeline #49949 passed with stage
in 43 seconds
import sys
import logging
import pytest
import itertools
from ewoksdask import execute_graph
from ewokscore.tests.examples import graphs
from ewokscore.tests.examples.graphs import graph_names
from ewokscore.tests.examples.graphs import get_graph
from ewokscore.tests.utils import assert_taskgraph_result
from ewokscore import load_graph
logging.getLogger("dask").setLevel(logging.DEBUG)
logging.getLogger("dask").addHandler(logging.StreamHandler(sys.stdout))
......@@ -11,9 +14,17 @@ logging.getLogger("ewoksdask").setLevel(logging.DEBUG)
logging.getLogger("ewoksdask").addHandler(logging.StreamHandler(sys.stdout))
@pytest.mark.parametrize("scheduler", [None, "multithreading", "multiprocessing"])
def test_execute_graph(tmpdir, scheduler):
@pytest.mark.parametrize(
"graph_name,scheduler",
itertools.product(graph_names(), (None, "multithreading", "multiprocessing")),
)
def test_examples(graph_name, tmpdir, scheduler):
graph, expected = get_graph(graph_name)
ewoksgraph = load_graph(graph)
varinfo = {"root_uri": str(tmpdir)}
graph, expected = graphs.acyclic_graph1()
execute_graph(graph, varinfo=varinfo, scheduler=scheduler)
assert_taskgraph_result(graph, expected, varinfo)
if ewoksgraph.is_cyclic or ewoksgraph.has_conditional_links:
with pytest.raises(RuntimeError):
execute_graph(graph, varinfo=varinfo)
else:
execute_graph(graph, varinfo=varinfo)
assert_taskgraph_result(ewoksgraph, expected, varinfo=varinfo)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment