From f2562ad27bb3d711d2abec004f5038cdecfd001d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 7 Dec 2022 21:58:51 -0500 Subject: [PATCH] TEST: Add regression test for merge nodes --- sdcflows/workflows/tests/test_base.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sdcflows/workflows/tests/test_base.py b/sdcflows/workflows/tests/test_base.py index f9f48a5440..97bf753ed3 100644 --- a/sdcflows/workflows/tests/test_base.py +++ b/sdcflows/workflows/tests/test_base.py @@ -62,5 +62,15 @@ def test_fmap_wf(tmpdir, workdir, outdir, bids_layouts, dataset, subject): if workdir: wf.base_dir = str(workdir) - if os.getenv("GITHUB_ACTIONS") != "true": - wf.run(plugin="Linear") + if os.getenv("GITHUB_ACTIONS") == "true": + return + + res = wf.run(plugin="Linear") + + # Regression test for when out_merge_fmap_coeff was flattened and would + # have twice as many elements as the other nodes + assert all( + len(node.result.outputs.out) == len(estimators) + for node in res.nodes + if node.name.startswith("out_merge_") + )