You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/07/20 06:06:27 UTC
[PR] test(frontend): extend WorkflowGraph unit test coverage [texera]
aglinxinyuan opened a new pull request, #6586:
URL: https://github.com/apache/texera/pull/6586
### What changes were proposed in this PR?
Extends the existing `workflow-graph.spec.ts` with 44 new tests (24 -> 68) for the `TexeraGraph` in-memory model, targeting previously-uncovered behavior:
- operator/link/port add-remove-get and their guard/throw branches;
- disabled / view-result / reuse-cache state toggles and their getters (incl. sink-ignore and idempotent no-ops);
- comment-box create/edit/delete and the `assert*` existence helpers;
- operator debug-state lifecycle;
- `getSubDAG` (full DAG from terminals, targeted root, disabled-operator/link exclusion, visited dedup on a diamond);
- `setPortProperty`; and every event-stream getter.
Reuses the existing direct-construction setup; adds an `afterEach` that tears down the shared model. Statement coverage for the file went from 262 uncovered lines to 18 (the remainder are unreachable defensive branches). No existing tests modified.
### Any related issues, documentation, discussions?
Closes #6583.
### How was this PR tested?
`npx ng test --watch=false --include='**/workflow-graph.spec.ts'` -> 68/68 passing. `yarn format:ci` passes.
### 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): extend WorkflowGraph unit test coverage [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6586:
URL: https://github.com/apache/texera/pull/6586#discussion_r3612308644
##########
frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts:
##########
@@ -34,6 +38,15 @@ describe("WorkflowGraph", () => {
workflowGraph = new WorkflowGraph();
});
+ afterEach(() => {
+ // tear down the underlying shared model (awareness / websocket provider) to avoid leaks across tests
+ try {
+ workflowGraph.destroyYModel();
+ } catch (e) {
+ // already destroyed (e.g. by a test that called destroyYModel/loadNewYModel) - ignore
+ }
+ });
Review Comment:
The afterEach teardown swallows all errors from destroyYModel(). This can hide real cleanup regressions (e.g., if SharedModel.destroy() starts throwing unexpectedly) and make the suite falsely pass. Since this spec doesn’t actually destroy the per-test workflowGraph anywhere else, it’s safer to let teardown failures surface and keep the hook simple.
--
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): extend WorkflowGraph unit test coverage [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #6586:
URL: https://github.com/apache/texera/pull/6586
--
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): extend WorkflowGraph unit test coverage [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6586:
URL: https://github.com/apache/texera/pull/6586#issuecomment-5019256903
<!-- 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:** `@Yicong-Huang`
You can notify them by mentioning `@Yicong-Huang` 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): extend WorkflowGraph unit test coverage [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan commented on code in PR #6586:
URL: https://github.com/apache/texera/pull/6586#discussion_r3612395004
##########
frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts:
##########
@@ -34,6 +38,15 @@ describe("WorkflowGraph", () => {
workflowGraph = new WorkflowGraph();
});
+ afterEach(() => {
+ // tear down the underlying shared model (awareness / websocket provider) to avoid leaks across tests
+ try {
+ workflowGraph.destroyYModel();
+ } catch (e) {
+ // already destroyed (e.g. by a test that called destroyYModel/loadNewYModel) - ignore
+ }
+ });
Review Comment:
Agreed — no test leaves the per-test workflowGraph destroyed (loadNewYModel installs a fresh model; the lone destroyYModel() is on a separate local graph), so the try/catch only masked potential regressions. Removed it; afterEach now calls destroyYModel() directly.
--
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