test(amber): unit tests for web/resource pure-logic helpers#5219
Open
Yicong-Huang wants to merge 1 commit into
Open
test(amber): unit tests for web/resource pure-logic helpers#5219Yicong-Huang wants to merge 1 commit into
Yicong-Huang wants to merge 1 commit into
Conversation
Covers a self-contained cluster of pure-logic helpers under org.apache.texera.web.resource that ship without direct unit coverage: EmailTemplate (admin/user registration branches + role change), FulltextSearchQueryUtils (pgroonga and fallback search predicates, contains / date / operators filters), EntityTables + EntityType (hub dispatch and Jackson round-trip), HealthCheckResource, and SuccessExecutionResult. Pins one whitespace-only-keyword edge case in FulltextSearchQueryUtils whose filter-before-trim ordering produces a degenerate empty-string pgroonga predicate; a future tightening should break that pinned test deliberately.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5219 +/- ##
============================================
+ Coverage 48.55% 48.79% +0.24%
- Complexity 2372 2378 +6
============================================
Files 1042 1042
Lines 39971 39971
Branches 4252 4252
============================================
+ Hits 19408 19504 +96
+ Misses 19414 19317 -97
- Partials 1149 1150 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
Add six ScalaTest specs covering a self-contained cluster of pure-logic helpers under
amber/src/main/scala/org/apache/texera/web/resource/that ship without direct unit coverage.EmailTemplateSpec— admin / user branches ofuserRegistrationNotification, optional-field fallbacks, role-change template perUserRoleEnum.FulltextSearchQueryUtilsSpec— pgroonga and fallbackto_tsvectorpredicates,getContainsFilterOR + set dedup,getDateFilteropen-ended endpoints + end-of-day bump +ParseException,getOperatorsFiltercase-insensitive LIKE.EntityTablesSpecandEntityTypeSpec— hub dispatch tables forWorkflowandDataset,CloneTable's asymmetric IAE onDataset, Jackson@JsonValue/@JsonCreatorround-trip.HealthCheckResourceSpecandSuccessExecutionResultSpec— the trivial contracts that deployment manifests and the frontend success-handler rely on.Pins one quirky edge case in
FulltextSearchQueryUtils.getFullTextSearchFilter:keywords.filter(_.nonEmpty)is applied beforemap(_.trim), so a whitespace-only keyword survives and produces a degeneratepgroonga_condition('', ...)predicate. A future fix (move the trim into the filter step) would break that pinned test deliberately.Any related issues, documentation, discussions?
Closes #5217.
How was this PR tested?
Added unit tests under
amber/src/test/scala/org/apache/texera/web/resource/.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7