From 54faaa74be07e602d19861ed5d511e323db42a26 Mon Sep 17 00:00:00 2001 From: Camila Diaz Date: Wed, 18 Aug 2021 13:30:55 -0500 Subject: [PATCH] fixtures: add tmp_shared_volume_path as a new top section on the workflows spec files Closes reanahub/reana-client#545 --- pytest_reana/fixtures.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pytest_reana/fixtures.py b/pytest_reana/fixtures.py index 6cf0053..50b0041 100644 --- a/pytest_reana/fixtures.py +++ b/pytest_reana/fixtures.py @@ -155,7 +155,7 @@ def test_default_user_exists(default) @pytest.fixture() -def serial_workflow(): +def serial_workflow(tmp_shared_volume_path): """Create a serial workflow. Scope: function @@ -175,12 +175,13 @@ def serial_workflow(): }, "type": "serial", }, + "workspace": {"workspace_root_path": tmp_shared_volume_path}, }, } @pytest.fixture() -def cwl_workflow_with_name(): +def cwl_workflow_with_name(tmp_shared_volume_path): """CWL workflow with name. Scope: function @@ -195,13 +196,14 @@ def cwl_workflow_with_name(): "type": "cwl", }, "type": "cwl", + "workspace": {"workspace_root_path": tmp_shared_volume_path}, }, "workflow_name": "my_test_workflow", } @pytest.fixture() -def yadage_workflow_with_name(): +def yadage_workflow_with_name(tmp_shared_volume_path): """Yadage workflow with name. Scope: function @@ -216,13 +218,14 @@ def yadage_workflow_with_name(): }, "inputs": {"parameters": {"min_year": "1991", "max_year": "2001"}}, "type": "yadage", + "workspace": {"workspace_root_path": tmp_shared_volume_path}, }, "name": "my_test_workflow", } @pytest.fixture() -def cwl_workflow_without_name(): +def cwl_workflow_without_name(tmp_shared_volume_path): """CWL workflow without name. Scope: function @@ -237,6 +240,7 @@ def cwl_workflow_without_name(): "type": "cwl", }, "type": "cwl", + "workspace": {"workspace_root_path": tmp_shared_volume_path}, }, "name": "", } @@ -654,12 +658,7 @@ def _create_sample_workflow_workspace(relative_workspace_path): @pytest.fixture() def sample_yadage_workflow_in_db( - app, - default_user, - session, - yadage_workflow_with_name, - sample_workflow_workspace, - tmp_shared_volume_path, + app, default_user, session, yadage_workflow_with_name, sample_workflow_workspace, ): """Create a sample workflow in the database. @@ -671,7 +670,11 @@ def sample_yadage_workflow_in_db( workflow_id = uuid4() relative_workspace_path = build_workspace_path( - default_user.id_, workflow_id, tmp_shared_volume_path + default_user.id_, + workflow_id, + yadage_workflow_with_name["reana_specification"]["workspace"][ + "workspace_root_path" + ], ) next(sample_workflow_workspace(relative_workspace_path)) workflow = Workflow( @@ -695,12 +698,7 @@ def sample_yadage_workflow_in_db( @pytest.fixture() def sample_serial_workflow_in_db( - app, - default_user, - session, - serial_workflow, - sample_workflow_workspace, - tmp_shared_volume_path, + app, default_user, session, serial_workflow, sample_workflow_workspace, ): """Create a sample workflow in the database. @@ -712,7 +710,9 @@ def sample_serial_workflow_in_db( workflow_id = uuid4() relative_workspace_path = build_workspace_path( - default_user.id_, workflow_id, tmp_shared_volume_path + default_user.id_, + workflow_id, + serial_workflow["reana_specification"]["workspace"]["workspace_root_path"], ) next(sample_workflow_workspace(relative_workspace_path)) workflow = Workflow(