mengw15 commented on code in PR #6017:
URL: https://github.com/apache/texera/pull/6017#discussion_r3644704477
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala:
##########
@@ -369,6 +372,46 @@ class WorkflowResourceSpec
assert(DashboardWorkflowEntryList.results.length == 2)
}
+ it should "return only single instance of workflow when owned and shared
publicly" in {
+ // Set workflow as public
+ testWorkflow1.setIsPublic(true)
+ // Create workflow with testUser as owner
+ workflowResource.persistWorkflow(testWorkflow1, sessionUser1)
+
+ val DashboardWorkflowEntryList =
+ dashboardResource.searchAllResourcesCall(
+ sessionUser1,
+ SearchQueryParams(),
+ includePublic = true
+ )
+ assert(DashboardWorkflowEntryList.results.length == 1)
+ assertSameWorkflow(testWorkflow1,
DashboardWorkflowEntryList.results.head.workflow.get)
+ }
Review Comment:
+1 on this — the two new tests mutate the shared `testWorkflow1` (a
suite-level `val`) via `setIsPublic(true)` with no reset, so it can leak into
the later tests that reuse it and make the suite order-dependent. A per-test
`Workflow` instance would fix it. Fine to do as a follow-up after this PR
rather than blocking it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]