Repository navigation
Description
Task Summary
amber/src/main/scala/org/apache/texera/web/resource/dashboard/DatasetSearchQueryBuilder.scala sits at 58.6% — 24 missed of 58 lines and only 6 of 18 branches. The existing DatasetSearchQueryBuilderSpec has 9 tests and asserts on rendered SQL only, so toEntryImpl — the half that builds what the dashboard actually displays — is entirely unexercised.
Worth establishing before writing anything, because the obvious approaches all fail here:
toEntryImplisoverride protectedon this builder, while theProjectandWorkflowsiblings widen theirs tooverride def. So the patternProjectSearchQueryBuilderSpecuses does not transfer, and widening the modifier would be a production edit. The route in is the trait's publictoEntry, which first runsUnifiedResourceSchema.translateRecord— meaning the input record must carry the aliased select fields, not the rawDATASET.*fields. Fetching the builder's own query is what supplies them.toEntryImplcalls LakeFS. Line 137 reachesLakeFSStorageClient.retrieveRepositorySize, which has no seam —HubResourceSpecgives up on exactly this, noting that an empty id list is the only input exercisable without a LakeFS server. A loopbackcom.sun.net.httpserverstub has to be duplicated into amber's test tree, becauseamber/build.sbtdeclares onlyDAO % "test->test"andAuth % "test->test", soworkflow-core's existing stub is not on amber's test classpath.- Do not repoint
StorageConfig.lakefsEndpointto reach that stub.LakeFSStorageClient'sapiClient,refsApiandobjectsApiare privatelazy vals that capture the endpoint once per JVM, and amber hasTags.limit(Tags.Test, 1)but noTest / fork, so the whole module shares one JVM.workflow-coregets away with mutating that global only because it forks its@NonParallelTestsuites. In amber the same move is order-dependent and leaves the client pointed at a dead port for every later suite. Bind the stub at the host and port the config already names instead — order-independent, nothing memoized wrongly. - Consequence: the port is machine-global. A local
bin/local-dev.sh upLakeFS, or a sibling worktree running amber tests, takes it, and the stub-dependent tests then have tocancel. That is a documented environmental skip rather than a failure, but be aware a cancel disarms the assertions too — it shows up only ascanceled N, with the build still green. FulltextSearchQueryUtils.usePgroongais a JVM-globalvardefaulting to true. Executing the query, as opposed to only rendering it, needs it false against plain postgres.DatasetResourceSpecalready sets it false inbeforeAlland never restores it, so that is the de-facto JVM state — an unrestored global the new tests inherit.- Line 141 can never be fully covered:
javapshows scala-logging expanding the error log into a one-sidedisErrorEnabledguard.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
Metadata
Metadata
Assignees
Labels
No labels
Activity
test(amber): cover the dataset search query builder's entry construct…