You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "mengw15 (via GitHub)" <gi...@apache.org> on 2026/08/15 04:34:45 UTC
[PR] test(frontend): cover the missing branches in four files [texera]
mengw15 opened a new pull request, #7688:
URL: https://github.com/apache/texera/pull/7688
### What changes were proposed in this PR?
Takes the missing side of each conditional in the four files, so their partial
branches clear. No production code was changed.
**`DatasetSelectionModalComponent`** (+4) — no dataset selected, so no version
list is fetched; a dataset selected in non-file mode, where the versions load but
none is auto-selected; a dataset with no version, so the file tree is not
fetched; and a file click in non-file mode, which leaves the path alone.
**`UdfDebugService`** (+12) — a condition set on a line that has no breakpoint;
clearing a breakpoint that lost its id; console events from another operator, with
no messages, and not from the debugger; a status update that is not
`Uninitialized`; stepping and deletion messages that carry no line number;
a deletion for a line with no debug state; creation messages missing the id, and
missing both id and line; a stepping message on an existing breakpoint; and the
two `markContinue` combinations the existing test did not reach.
**`HubWorkflowDetailComponent`** (+8) — a workflow with a description and one
with an empty description, asserting the placeholder reaches the description
child; `postUnlike` reporting failure; the refreshed counts carrying no `like`
on both the like and the unlike path; and the two `wid` re-checks inside the
like/unlike handlers. The two like/unlike responses are asynchronous in
production, so a `Subject` stands in for the pending request and the id is
cleared between issuing the call and the response arriving — `of(...)` resolves
too early to reach those `return`s.
**`UserDatasetComponent`** (+9) — both view-child accessors read before the view
is initialized, so each `throw` runs, and read after assignment; the filter
component reporting a change; and the search de-duplication guard driven one
condition at a time: unchanged, forced, a changed sort method, a filter added,
and a filter replaced by another (same length, different contents, which only the
element-wise comparison distinguishes).
Two spots named by the issue are not reachable and are left uncovered:
- `UserDatasetComponent`'s `if (!this.searchResultsComponent) throw new
Error("searchResultsComponent is undefined.")` is dead. The accessor above it
either returns a truthy component or throws, so the negation is never true —
the "before it is initialized" error is what actually fires, and that is the
one the tests assert.
- `hub-workflow-detail.component.ts:65` is the class declaration line, which the
source map attributes TypeScript's emitted decorator helper to. It was already
uncovered before this change (baseline unhit lines were `65,239,257`; 239 and
257 are the two `return`s this PR covers).
### Any related issues, documentation, discussions?
Closes #7686
### How was this PR tested?
Extended unit tests, run locally in `frontend/` (all green; the failure paths
were verified by breaking assertions in each file and confirming the suites go
red and exit non-zero):
```
ng test --watch=false --include .../dataset-selection-modal.component.spec.ts # 11 passed
ng test --watch=false --include .../udf-debug.service.spec.ts # 33 passed
ng test --watch=false --include .../hub-workflow-detail.component.spec.ts # 42 passed
ng test --watch=false --include .../user-dataset.component.spec.ts # 35 passed
prettier --write <specs> # clean
eslint <specs> # clean
```
The coverage report was re-run over the four specs to confirm the partials
cleared: `dataset-selection-modal.component.ts` and `udf-debug.service.ts` reach
100% of statements with no partial or never-taken branch left;
`hub-workflow-detail.component.ts` and `user-dataset.component.ts` are left only
with the two unreachable spots described above.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])
--
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(frontend): cover the missing branches in the dataset modal, UDF debug, hub detail and dataset page [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7688:
URL: https://github.com/apache/texera/pull/7688#issuecomment-5300576497
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7688?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 90.40%. Comparing base ([`ae04417`](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`0eb4c66`](https://app.codecov.io/gh/apache/texera/commit/0eb4c66f2ade1a0e32379fbada43a87bb4464b71?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 2 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #7688 +/- ##
============================================
+ Coverage 90.33% 90.40% +0.06%
Complexity 4428 4428
============================================
Files 1175 1175
Lines 47131 47131
Branches 5285 5285
============================================
+ Hits 42578 42608 +30
+ Misses 2786 2777 -9
+ Partials 1767 1746 -21
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/7688/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/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/7688/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 [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?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/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.06% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?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/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.46% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?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/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.55% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.90% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?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/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.77% <ø> (+0.14%)` | :arrow_up: | |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `79.31% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.57% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?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/7688/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.89% <ø> (ø)` | | Carriedforward from [ae04417](https://app.codecov.io/gh/apache/texera/commit/ae04417af8a7da46c5b3c2a3d8da67c7065b58f4?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/7688?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(frontend): cover the missing branches in four files [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7688:
URL: https://github.com/apache/texera/pull/7688#issuecomment-5300549968
<!-- 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:** `@aglinxinyuan`, `@tanishqgandhi1908`, `@Ma77Ball`
You can notify them by mentioning `@aglinxinyuan`, `@tanishqgandhi1908`, `@Ma77Ball` 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
Re: [PR] test(frontend): cover the missing branches in the dataset modal, UDF debug, hub detail and dataset page [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 commented on code in PR #7688:
URL: https://github.com/apache/texera/pull/7688#discussion_r3788521750
##########
frontend/src/app/workspace/service/operator-debug/udf-debug.service.spec.ts:
##########
@@ -464,4 +464,170 @@ describe("UdfDebugServiceSpec", () => {
expect(debugState.get("1")).toEqual({ breakpointId: 1, condition: "x > 5", hit: false });
expect(debugState.has("2")).toBe(false);
});
+
+ // Builds the (Pdb) DEBUGGER console event shape that every handler below filters on.
+ function pdbEvent(title: string, overrides: Partial<ConsoleMessage> = {}): ConsoleUpdateEvent {
+ return {
+ operatorId: mockPythonUDFPredicate.operatorID,
+ messages: [
+ {
+ workerId: stubWorker,
+ timestamp: { nanos: 0, seconds: 0 },
+ title,
+ source: "(Pdb)",
+ msgType: { name: "DEBUGGER" },
+ message: "",
+ ...overrides,
+ },
+ ],
+ };
+ }
+
+ it("should not send a condition for a line that has no breakpoint", () => {
+ // The condition differs from the empty default, so the early return is passed and
+ // the `isDefined(breakpointInfo)` guard is the one that stops the update.
+ const debugState = service.getDebugState(mockPythonUDFPredicate.operatorID);
+
+ service.doUpdateBreakpointCondition(mockPythonUDFPredicate.operatorID, 7, "x < 10");
+
+ expect(mockWorkflowWebsocketService.send).not.toHaveBeenCalled();
+ expect(debugState.has("7")).toBe(false);
+ });
+
+ it("should clear a breakpoint that lost its id with an empty id", () => {
+ // State a hit breakpoint is left in once pdb deleted it: still present, so the
+ // command is `clear`, but with no id to clear by.
+ const debugState = service.getDebugState(mockPythonUDFPredicate.operatorID);
+ debugState.set("10", { breakpointId: undefined, condition: "", hit: true });
+
+ service.doModifyBreakpoint(mockPythonUDFPredicate.operatorID, 10);
+
+ expect(mockWorkflowWebsocketService.send).toHaveBeenCalledWith("DebugCommandRequest", {
+ operatorId: mockPythonUDFPredicate.operatorID,
+ workerId: stubWorker,
+ cmd: "clear ",
+ });
Review Comment:
`clear ` is the literal payload that goes over the websocket on this path — the trailing space comes from the `|| ""` fallback. Asserting the exact string is the point: a change to that format changes what the debugger receives. Added a comment so it does not read as accidental.
--
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(frontend): cover the missing branches in the dataset modal, UDF debug, hub detail and dataset page [texera]
Posted by "mengw15 (via GitHub)" <gi...@apache.org>.
mengw15 merged PR #7688:
URL: https://github.com/apache/texera/pull/7688
--
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(frontend): cover the missing branches in four files [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7688:
URL: https://github.com/apache/texera/pull/7688#discussion_r3788500326
##########
frontend/src/app/workspace/service/operator-debug/udf-debug.service.spec.ts:
##########
@@ -464,4 +464,170 @@ describe("UdfDebugServiceSpec", () => {
expect(debugState.get("1")).toEqual({ breakpointId: 1, condition: "x > 5", hit: false });
expect(debugState.has("2")).toBe(false);
});
+
+ // Builds the (Pdb) DEBUGGER console event shape that every handler below filters on.
+ function pdbEvent(title: string, overrides: Partial<ConsoleMessage> = {}): ConsoleUpdateEvent {
+ return {
+ operatorId: mockPythonUDFPredicate.operatorID,
+ messages: [
+ {
+ workerId: stubWorker,
+ timestamp: { nanos: 0, seconds: 0 },
+ title,
+ source: "(Pdb)",
+ msgType: { name: "DEBUGGER" },
+ message: "",
+ ...overrides,
+ },
+ ],
+ };
+ }
+
+ it("should not send a condition for a line that has no breakpoint", () => {
+ // The condition differs from the empty default, so the early return is passed and
+ // the `isDefined(breakpointInfo)` guard is the one that stops the update.
+ const debugState = service.getDebugState(mockPythonUDFPredicate.operatorID);
+
+ service.doUpdateBreakpointCondition(mockPythonUDFPredicate.operatorID, 7, "x < 10");
+
+ expect(mockWorkflowWebsocketService.send).not.toHaveBeenCalled();
+ expect(debugState.has("7")).toBe(false);
+ });
+
+ it("should clear a breakpoint that lost its id with an empty id", () => {
+ // State a hit breakpoint is left in once pdb deleted it: still present, so the
+ // command is `clear`, but with no id to clear by.
+ const debugState = service.getDebugState(mockPythonUDFPredicate.operatorID);
+ debugState.set("10", { breakpointId: undefined, condition: "", hit: true });
+
+ service.doModifyBreakpoint(mockPythonUDFPredicate.operatorID, 10);
+
+ expect(mockWorkflowWebsocketService.send).toHaveBeenCalledWith("DebugCommandRequest", {
+ operatorId: mockPythonUDFPredicate.operatorID,
+ workerId: stubWorker,
+ cmd: "clear ",
+ });
Review Comment:
This assertion pins an exact trailing space in the debug command ("clear "), which makes the test unnecessarily brittle (e.g., if the implementation is later normalized to "clear" with no trailing whitespace). Prefer matching the intended shape (a clear command with no id) rather than exact whitespace.
--
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