You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "eugenegujing (via GitHub)" <gi...@apache.org> on 2026/08/11 21:54:13 UTC
[PR] test(computing-unit): cover the create, rename and configuration endpoints [texera]
eugenegujing opened a new pull request, #7580:
URL: https://github.com/apache/texera/pull/7580
### What changes were proposed in this PR?
This PR extends `ComputingUnitManagingResourceSpec` (added in #6853, extended in #7337) to the endpoints of `ComputingUnitManagingResource` that had no coverage. The existing spec only covered `getComputingUnitInfo`, `getComputingUnitMetricsEndpoint`, `listComputingUnits` and `terminateComputingUnit`; 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:
- **createWorkflowComputingUnit** — local happy path (persisted with a generated `cuid`, the user URI landing in both the `uri` column and the resource JSON's `nodeAddresses`, response reporting owner/WRITE/Running with NaN metrics); whitespace-only name rejected with `ForbiddenException` and nothing stored; unknown type (`quantum`) rejected; `kubernetes` type rejected while disabled; missing and blank URI rejected; the per-user running-unit quota not applying to local units.
- **renameComputingUnit** — owner success; non-owner without access 403 (name kept); READ-only grantee 403; WRITE grantee success; blank name 400; nonexistent unit `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).
- **terminateComputingUnit** — a WRITE grantee rejected with 400 and the unit not terminated (terminate requires strict ownership or the ADMIN role).
- **getComputingUnitInfo** — a READ grantee sees the unit with `isOwner = false` and `accessPrivilege = READ`; a nonexistent unit yields `NotFoundException`; the owner response also reports the non-empty owner avatar.
- **getComputingUnitTypes** — lists exactly `local` while Kubernetes is disabled.
- **getComputingUnitLimitOptions** — returns the configured cpu/memory/gpu option lists.
- **getComputingUnitResourceLimit** — the local branch returns NaN limits for the owner; a non-owner gets `BadRequestException`; a nonexistent unit yields `NotFoundException`.
- **getComputingUnitMetricsEndpoint** — adds the missing negative direction: a non-owner gets `BadRequestException`.
Note: the Kubernetes-only validation in `createWorkflowComputingUnit` sits behind the supported-type gate and is unreachable while `kubernetes.enabled` is 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:
```
sbt "ComputingUnitManagingService/testOnly org.apache.texera.service.resource.ComputingUnitManagingResourceSpec"
```
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 `getComputingUnitTypes` also return `kubernetes`, and removing the non-owner check in `getComputingUnitResourceLimit`) each caused at least one new test to fail, and the source was restored afterwards. `ComputingUnitManagingService/Test/scalafmtCheck` passes.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored by: Claude Code (Claude Fable 5)
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(computing-unit): extend ComputingUnitManagingResourceSpec to cover the create, rename and configuration endpoints [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7580:
URL: https://github.com/apache/texera/pull/7580#issuecomment-5259319292
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7580?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 87.88%. Comparing base ([`e878df3`](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3900c9d`](https://app.codecov.io/gh/apache/texera/commit/3900c9da33d8c00eae778b32799e584dd64b6574?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #7580 +/- ##
=========================================
Coverage 87.88% 87.88%
Complexity 4276 4276
=========================================
Files 1176 1176
Lines 47018 47018
Branches 5245 5245
=========================================
Hits 41323 41323
Misses 3972 3972
Partials 1723 1723
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.62% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `82.88% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.38% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.97% <ø> (ø)` | | |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.05% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.94% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.89% <ø> (ø)` | | |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.52% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7580/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.31% <ø> (ø)` | | Carriedforward from [e878df3](https://app.codecov.io/gh/apache/texera/commit/e878df3eee7ca3baee7b0c34eceb63548c59e68a?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/7580?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(computing-unit): extend ComputingUnitManagingResourceSpec to cover the create, rename and configuration endpoints [texera]
Posted by "eugenegujing (via GitHub)" <gi...@apache.org>.
eugenegujing commented on PR #7580:
URL: https://github.com/apache/texera/pull/7580#issuecomment-5275760645
/request-review @aglinxinyuan
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(computing-unit): extend ComputingUnitManagingResourceSpec to cover the create, rename and configuration endpoints [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7580:
URL: https://github.com/apache/texera/pull/7580
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(computing-unit): cover the create, rename and configuration endpoints [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7580:
URL: https://github.com/apache/texera/pull/7580#issuecomment-5259291006
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- **Contributors with relevant context:** `@Neilk1021`
You can notify them by mentioning `@Neilk1021` in a comment.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org