Skip to content

Commit

Permalink
fixtures: add tmp_shared_volume_path as a new top section on the work…
Browse files Browse the repository at this point in the history
…flows spec files

Closes reanahub/reana-client#545
  • Loading branch information
marcdiazsan committed Aug 18, 2021
1 parent 040cf9b commit 54faaa7
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pytest_reana/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -237,6 +240,7 @@ def cwl_workflow_without_name():
"type": "cwl",
},
"type": "cwl",
"workspace": {"workspace_root_path": tmp_shared_volume_path},
},
"name": "",
}
Expand Down Expand Up @@ -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.
Expand All @@ -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(
Expand All @@ -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.
Expand All @@ -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(
Expand Down

0 comments on commit 54faaa7

Please sign in to comment.