Repository navigation
Description
Task Summary
FulltextSearchQueryUtilsSpec is the only spec in amber/src/main/scala/org/apache/texera/web/resource/dashboard/. It also demonstrates that this tier does not need a database to test: a dialect-only DSL.using(SQLDialect.POSTGRES) context renders jOOQ Condition/Field objects with no connection, and ctx.newRecord(...) builds records purely in memory.
Three members of the tier are connection-free and untested:
DashboardResource.getOrderFields(22 missed lines in the file) — public and pure. It regex-matchesorderByagainst(Name|CreateTime|EditTime|ExecutionTime)(Asc|Desc). Existing coverage is only incidental, viaWorkflowResourceSpec, and reachesNameAsc/NameDesc,ExecutionTimeAsc/DescandEditTimethrough the default.CreateTimeAsc/CreateTimeDescand the non-matching fall-through are unreached. The asc/desc asymmetry is also worth pinning:Descemitsdesc nulls lastwhileAscemits a bareasc, and that asymmetry is what makes the observable behaviour symmetric, since Postgres defaults to NULLS LAST for ASC and NULLS FIRST for DESC. Separately,searchAllResourceswith an unrecognisedresourceTypethrowsIllegalArgumentExceptionbefore any query is constructed, so that path needs no database either.WorkflowSearchQueryBuilder.toEntryImplandmappedResourceSchema(7 missed) — reachable because this object drops the trait'sprotected, unlikeDatasetSearchQueryBuilderwhose five members are alloverride protected(Scalaprotectedgrants no same-package access, so those are not callable from a spec).toEntryImplis pure record-to-DTO mapping: the projects aggregate is looked up by structural jOOQFieldequality, the comma-joined value is split intoIntegers, a NULL privilege degrades toNONE, and an ownership flag compares uids.UnifiedResourceSchema.apply(5 missed) — 24 default-argumentFields, plus a keep-first de-duplication behindallFieldsthat collapses repeated originals.
translateRecord, resultsOwnersInfo, searchAllPublicResourceCall, constructQuery and every fetch path route through SqlServer.getInstance().createDSLContext() and are out of scope for a no-DB spec.
Note for whoever picks this up: FulltextSearchQueryUtils.usePgroonga is a JVM-global var that DatasetResourceSpec and WorkflowResourceSpec both set to false in beforeAll and never restore, and amber's suites run concurrently in one JVM. New specs here should neither depend on its default nor mutate it.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
Activity
test(amber): add no-DB specs for the dashboard search query tier (apa…