test(computing-unit): extend ComputingUnitManagingResourceSpec to cover the create, rename and configuration endpoints - #7580
Merged
aglinxinyuan merged 1 commit intoAug 13, 2026
Conversation
…oints Extend ComputingUnitManagingResourceSpec to the createWorkflowComputingUnit, renameComputingUnit, getComputingUnitTypes, getComputingUnitLimitOptions and getComputingUnitResourceLimit endpoints, using local-type units against the embedded database.
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7580 +/- ##
============================================
+ Coverage 87.88% 87.99% +0.10%
- Complexity 4276 4292 +16
============================================
Files 1176 1176
Lines 47018 47018
Branches 5245 5245
============================================
+ Hits 41323 41373 +50
+ Misses 3972 3920 -52
- Partials 1723 1725 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/request-review @aglinxinyuan |
aglinxinyuan
approved these changes
Aug 13, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 13, 2026
renovate-bot
pushed a commit
to renovate-bot/apache-_-texera
that referenced
this pull request
Aug 13, 2026
…ache#7633) ### What changes were proposed in this PR? **`main` does not compile.** Any PR whose `build / amber` or `build / amber-integration` jobs run after this landed fails on it regardless of what the PR itself touches — apache#7631 is an example, where the only change is four tests in an unrelated module's spec. Scoping that honestly: PRs whose amber jobs ran *before* the breakage still show green and would fail on re-run, and frontend-labelled PRs skip the amber stack, so this is "every amber run from now until it is fixed" rather than "every open PR is red today". `ComputingUnitManagingResourceSpec` asserts on `DashboardWorkflowComputingUnit.ownerGoogleAvatar`, but the field is named `ownerAvatar`, so `ComputingUnitManagingService / Test` fails with two "value ownerGoogleAvatar is not a member" errors. Two PRs raced to produce it: apache#7563 renamed the field to `ownerAvatar`, while apache#7580 added assertions written against the old name. Each was green against its own base, and the combination is what breaks — the kind of thing per-PR CI cannot see when two PRs touch different files. This renames the two accessor calls. Nothing else changes. ### How was this PR tested? Confirmed the breakage is real and that this is the whole of it, by stashing the change and re-running on otherwise-clean `main`: ``` sbt "ComputingUnitManagingService/Test/compile" ``` | | Result | |---|---| | unpatched `main` | exit 1, exactly 2 × `value ownerGoogleAvatar is not a member` | | with this change | exit 0, compiles clean | Then the spec itself: ``` sbt "ComputingUnitManagingService/testOnly org.apache.texera.service.resource.ComputingUnitManagingResourceSpec" ``` ``` [info] Total number of tests run: 31 [info] Tests: succeeded 31, failed 0, canceled 0, ignored 0, pending 0 ``` All 31 pass, so the assertions were correct about the value and only the accessor name was stale. `Test/scalafmtCheck` and `Test/scalafix --check` both pass. ### Any related issues, documentation, discussions? Closes apache#7632 ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5)
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?
This PR extends
ComputingUnitManagingResourceSpec(added in #6853, extended in #7337) to the endpoints ofComputingUnitManagingResourcethat had no coverage. The existing spec only coveredgetComputingUnitInfo,getComputingUnitMetricsEndpoint,listComputingUnitsandterminateComputingUnit; the create, rename and configuration endpoints were untested.All new tests keep the existing spec's approach: local-type units driven against the embedded Postgres (
MockTexeraDB), so no Kubernetes calls are made. New coverage, by endpoint:cuid, the user URI landing in both theuricolumn and the resource JSON'snodeAddresses, response reporting owner/WRITE/Running with NaN metrics); whitespace-only name rejected withForbiddenExceptionand nothing stored; unknown type (quantum) rejected;kubernetestype rejected while disabled; missing and blank URI rejected; the per-user running-unit quota not applying to local units.NotFoundException; database failure (name overflowing the VARCHAR(128) column) rolling back and keeping the name; and an admin who neither owns nor was granted access getting 403 (rename, unlike terminate, has no ADMIN bypass).isOwner = falseandaccessPrivilege = READ; a nonexistent unit yieldsNotFoundException; the owner response also reports the non-empty owner avatar.localwhile Kubernetes is disabled.BadRequestException; a nonexistent unit yieldsNotFoundException.BadRequestException.Note: the Kubernetes-only validation in
createWorkflowComputingUnitsits behind the supported-type gate and is unreachable whilekubernetes.enabledis false; that flag is a load-time val the test JVM does not override, so those branches cannot be exercised in this suite. A spec comment records this.No production code is changed.
Any related issues, documentation, discussions?
Closes #7576
How was this PR tested?
This PR is itself test-only. The new specs were run with:
All 31 tests pass (7 pre-existing + 24 new) against the embedded database; no external services are needed. The suite was mutation-checked: targeted mutations of the resource (removing the blank-name and missing-URI checks, inverting the rename ownership gate, skipping the rename blank-name 400, making
getComputingUnitTypesalso returnkubernetes, and removing the non-owner check ingetComputingUnitResourceLimit) each caused at least one new test to fail, and the source was restored afterwards.ComputingUnitManagingService/Test/scalafmtCheckpasses.Was this PR authored or co-authored using generative AI tooling?
Co-authored by: Claude Code (Claude Fable 5)