Skip to content

Commit b4732d0

Browse files
committed
Fix unit tests for viewonly History.datasets and Workflow.parent_workflow_steps
History.datasets is now viewonly, so it queries the DB instead of reading the in-memory collection. Flush after collect so the unflushed HDA is visible to the query. Workflow.parent_workflow_steps is now viewonly, so the cascade that previously pulled the parent workflow into the session no longer fires. Add the invocation to the session explicitly so FK columns on workflow step connections are synced on commit.
1 parent 243b1a0 commit b4732d0

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

test/unit/app/tools/test_collect_primary_datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def test_copied_to_imported_histories(self):
197197
assert len(history_2.datasets) == 1
198198

199199
self._collect()
200+
self.app.model.context.flush()
200201

201202
# Make sure extra primary was copied to cloned history with
202203
# cloned output.

test/unit/workflows/test_workflow_progress.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def test_subworkflow_progress(self):
196196
self.invocation.workflow.step_by_index(1)
197197
)
198198
session = self.app.model.session
199+
session.add(self.invocation)
199200
session.add(subworkflow_invocation)
200201
session.commit()
201202
progress = self._new_workflow_progress()

0 commit comments

Comments
 (0)