aglinxinyuan commented on code in PR #7464:
URL: https://github.com/apache/texera/pull/7464#discussion_r3916415054
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/DatasetSearchQueryBuilderSpec.scala:
##########
@@ -542,23 +542,22 @@ class DatasetSearchQueryBuilderSpec
sql should include("user.email as email")
}
- it should "stay union-compatible with the workflow and project branches" in {
- // `DashboardResource.searchAllResources` stacks the three builders with
`unionAll` for a
+ it should "stay union-compatible with the workflow branch" in {
+ // `DashboardResource.searchAllResources` stacks both builders with
`unionAll` for a
Review Comment:
Applied both — "the three builders", and the parenthetical now reads
"dataset and model both project `DSL.inline("")`". You're right that my rewrite
counted the model branch out along with the project branch; the test itself
stays a two-branch check as you say.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/file/WorkflowResourceSpec.scala:
##########
@@ -681,99 +634,104 @@ class WorkflowResourceSpec
)
}
- "/search API" should "be able to search for resources in different tables"
in {
+ "/search API" should "be able to search for resources by keyword" in {
- // create different types of resources, project, workflow, and file
- projectResource.createProject(sessionUser1, "test project1")
workflowResource.persistWorkflow(testWorkflow1, sessionUser1)
// search
val DashboardClickableFileEntryList =
dashboardResource.searchAllResourcesCall(
sessionUser1,
SearchQueryParams(getKeywordsArray("test"))
)
- assert(DashboardClickableFileEntryList.results.length == 2)
+ assert(DashboardClickableFileEntryList.results.length == 1)
}
it should "return all resources when no keyword provided" in {
- projectResource.createProject(sessionUser1, "test project1")
workflowResource.persistWorkflow(testWorkflow1, sessionUser1)
val DashboardClickableFileEntryList =
dashboardResource.searchAllResourcesCall(
sessionUser1,
SearchQueryParams(getKeywordsArray(""))
)
- assert(DashboardClickableFileEntryList.results.length == 2)
+ assert(DashboardClickableFileEntryList.results.length == 1)
}
it should "return multiple matching resources from a single resource type"
in {
workflowResource.persistWorkflow(testWorkflow1, sessionUser1)
- projectResource.createProject(sessionUser1, "common project1")
- projectResource.createProject(sessionUser1, "common project2")
+ workflowResource.persistWorkflow(testWorkflow2, sessionUser1)
val DashboardClickableFileEntryList =
dashboardResource.searchAllResourcesCall(
sessionUser1,
- SearchQueryParams(getKeywordsArray("common"))
+ SearchQueryParams(getKeywordsArray("test"))
)
assert(DashboardClickableFileEntryList.results.length == 2)
}
it should "handle multiple keywords correctly" in {
- projectResource.createProject(sessionUser1, "test project1")
workflowResource.persistWorkflow(testWorkflow1, sessionUser1)
+ workflowResource.persistWorkflow(testWorkflow2, sessionUser1)
val DashboardClickableFileEntryList =
dashboardResource.searchAllResourcesCall(
sessionUser1,
- SearchQueryParams(getKeywordsArray("test", "project1"))
+ SearchQueryParams(getKeywordsArray("test", "workflow1"))
)
assert(
DashboardClickableFileEntryList.results.length == 1
- ) // should only return the project
+ ) // should only return test_workflow1
}
it should "filter results by different resourceType" in {
- // create different types of resources
- // 3 projects, 2 file, and 1 workflow,
- projectResource.createProject(sessionUser1, "test project1")
- projectResource.createProject(sessionUser1, "test project2")
- projectResource.createProject(sessionUser1, "test project3")
+ // create 3 workflows
workflowResource.persistWorkflow(testWorkflow1, sessionUser1)
+ workflowResource.persistWorkflow(testWorkflow2, sessionUser1)
+ workflowResource.persistWorkflow(testWorkflow3, sessionUser1)
// search resources with all resourceType
var DashboardClickableFileEntryList =
dashboardResource.searchAllResourcesCall(
sessionUser1,
SearchQueryParams(getKeywordsArray("test"))
)
- assert(DashboardClickableFileEntryList.results.length == 4)
+ assert(DashboardClickableFileEntryList.results.length == 3)
// filter resources by workflow
DashboardClickableFileEntryList = dashboardResource.searchAllResourcesCall(
sessionUser1,
SearchQueryParams(resourceType = "workflow", keywords =
getKeywordsArray("test"))
)
- assert(DashboardClickableFileEntryList.results.length == 1)
+ assert(DashboardClickableFileEntryList.results.length == 3)
- // filter resources by project
+ // filter resources by dataset
DashboardClickableFileEntryList = dashboardResource.searchAllResourcesCall(
sessionUser1,
- SearchQueryParams(resourceType = "project", keywords =
getKeywordsArray("test"))
+ SearchQueryParams(resourceType = "dataset", keywords =
getKeywordsArray("test"))
)
- assert(DashboardClickableFileEntryList.results.length == 3)
+ assert(DashboardClickableFileEntryList.results.isEmpty)
+
+ // The counts above cannot distinguish a working filter from an ignored
one, because every
+ // seeded row is a workflow and the only other searchable type is
LakeFS-backed (a seeded
Review Comment:
Reverted to the plural — you were right both times, the merge added `model`
between the two rounds. No apology needed; this is the fourth time main has
moved prose under this PR, and it is the reason I now re-derive these
statements from the code on each round rather than carrying them forward.
Also corrected the two description claims from your summary, taken from the
live PR rather than the delta: the tally is now "8 files deleted, 21 edited, 1
added (+153 / −2012)", and I verified the arity claim is `Record11` →
`Record10` (main has `Record11`, this branch has `Record10`).
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]