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/08/26 08:51:15 UTC
[PR] test(frontend): cover the time-travel poller and the feedback component [texera]
aglinxinyuan opened a new pull request, #7992:
URL: https://github.com/apache/texera/pull/7992
### What changes were proposed in this PR?
Three small frontend components, measured from lcov with the same spec filter on both sides.
| File | Codecov | lcov detail |
|---|---|---|
| `time-travel.component.ts` | 92.3% → **100%** | branches 20/22 → 22/22; functions 17/18 → 18/18 |
| `feedback.component.ts` | 85.2% → **100%** | branches 14/17 → 17/17; functions 8/11 → 11/11 |
| `feedback.component.html` | 83.3% → **100%** | branches 2/4 → 4/4; **functions 0/2 → 2/2** |
| `repeat-dnd.component.html` | 86.4% → **95.5%** | one arm left deliberately — see below |
| `repeat-dnd.component.ts` (incidental) | 90.9% → **100%** | branches 17/18 → 18/18 |
**+14 fully-covered lines, +9 branch arms, +7 functions.**
The template's function counter is the one to notice: `feedback.component.html` was at **zero of two functions covered** behind an 83% line figure. That is the fifth time in this campaign the function counter found what the line counter hid. `time-travel.component.ts`'s zero-hit lines 84-88 were the entire `ngOnInit` timer lambda body.
**`port-property-edit-frame.component.ts` was in scope and is absent.** It is worth exactly zero: two of its three residual lines are dead Quill config and the third is unreachable in practice. No tests were added there and no mutations run.
### A production defect found while assessing it
Chasing those two Quill lines turned up a real bug rather than coverage: the port-name editor's keyboard bindings use `key: 13`, which is **Quill 1 syntax that Quill 2 never dispatches**. So pressing Enter in the port-name editor inserts a newline into the shared display name instead of closing the editor. Reported, not pinned — pinning current behaviour would cement it.
### One arm left uncovered on purpose
`repeat-dnd.component.html` line 48 is the **remove** button's `[disabled]="field.templateOptions?.disabled"`, and issue **#7431** records that the enclosing `*ngFor` shadows the outer `field`, so it never disables. That arm is deliberately not pinned. The assertion added in that spec is on the **add** button, and it carries a comment explaining why an absent `templateOptions` object must not read as disabled.
### Verification
28 mutations, **24 killed, 4 recorded.**
The first draft's headline was false: it claimed "survivors: NONE, every one of the 14 new tests proven by a mutation actually applied and run". **Eight mutants survived it** — seven found by review plus one found here (deleting an `[nzLoading]` binding). All eight now die.
Its survivor-to-mutation mapping was also wrong in one place: two separate mutations had been given the same number, so a kill was credited to the wrong row.
The four recorded non-kills are: the #7431 arm above (refused), an equivalent mutant (`[nzData]="[...feedbackList]"` → `[nzData]="feedbackList"` — the spread produces an equal array), and two entries covering `port-property-edit-frame`, where no tests were added.
One further correction worth making: `feedback.component.html` reaching 24/24 is **not** a quality claim on its own. At 24/24 the file is fully *executed*; what makes it constrained is the mutations, not the percentage.
No production file is touched. The worktree used a real yarn install rather than a `node_modules` junction.
### Any related issues, documentation, discussions?
Closes #7990
### How was this PR tested?
```
npx ng test --watch=false --include="**/time-travel.component.spec.ts" --include="**/feedback.component.spec.ts" --include="**/repeat-dnd.component.spec.ts"
```
```
Test Files 3 passed (3)
```
`yarn format:ci` passes. `frontend/junit.xml` and `frontend/coverage/` are regenerated by every run and are not committed.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 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(frontend): cover the time-travel poller and the feedback component [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7992:
URL: https://github.com/apache/texera/pull/7992
--
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 time-travel poller and the feedback component [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7992:
URL: https://github.com/apache/texera/pull/7992#issuecomment-5423163127
<!-- 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:** `@aicam`, `@mengw15`
You can notify them by mentioning `@aicam`, `@mengw15` 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 time-travel poller and the feedback component [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7992:
URL: https://github.com/apache/texera/pull/7992#discussion_r3867579986
##########
frontend/src/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts:
##########
@@ -231,6 +231,69 @@ describe("TimeTravelComponent", () => {
});
});
+ /**
+ * The panel keeps itself up to date from a `timer(0, 5000)` poller started in ngOnInit.
+ * The fixture built by the outer beforeEach cannot be used to drive it: `src/test-zone-setup.ts`
+ * installs the ProxyZone that fakeAsync patches around the `it` body only, so anything
+ * scheduled from a beforeEach — including the poller that beforeEach's detectChanges starts
+ * (inert there, since the metadata stub reports no wid) — lives in the real zone, out of
+ * tick()'s reach. These tests therefore re-run ngOnInit from inside the fakeAsync body,
+ * which is where timer(0, 5000) has to be created for tick() to drive it, and destroy the
+ * fixture at the end so @UntilDestroy unsubscribes the periodic timer.
+ */
+ describe("ngOnInit polling", () => {
+ it("skips the refresh while the workflow has no id", fakeAsync(() => {
+ metadataSpy.mockReturnValue(undefined as any);
+ const widSpy = vi.spyOn(component, "getWid");
+ const displaySpy = vi.spyOn(component, "displayExecutionWithLogs").mockImplementation(() => {});
+
+ component.ngOnInit();
+ tick(0); // the first emission of timer(0, 5000) is asynchronous
+
+ // getWid pins that the poller actually ran: without it the negative assertion
+ // below would also pass with the poller never firing at all.
+ expect(widSpy).toHaveBeenCalledTimes(1);
+ expect(displaySpy).not.toHaveBeenCalled();
+
+ fixture.destroy();
Review Comment:
This `fixture.destroy()` runs inside the test, but the suite-level `afterEach` already unconditionally calls `fixture.destroy()`. Double-destroy can throw (and is guarded against in other specs), making these polling tests flaky. Stop the poller within fakeAsync by invoking the component's OnDestroy hook, and let `afterEach` do the actual fixture teardown once.
This issue also appears in the following locations of the same file:
- line 279
- line 290
--
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 time-travel poller and the feedback component [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7992:
URL: https://github.com/apache/texera/pull/7992#issuecomment-5423761464
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7992?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 93.24%. Comparing base ([`5de9bf9`](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`57d4dcf`](https://app.codecov.io/gh/apache/texera/commit/57d4dcffcdcdfa4ebb48dd27aa029fd494485c25?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 #7992 +/- ##
============================================
+ Coverage 93.21% 93.24% +0.03%
Complexity 4664 4664
============================================
Files 1175 1175
Lines 47646 47646
Branches 5319 5319
============================================
+ Hits 44413 44428 +15
+ Misses 1752 1739 -13
+ Partials 1481 1479 -2
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/7992/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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.00% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `99.32% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.31% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.67% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.73% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.70% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `95.74% <ø> (+0.07%)` | :arrow_up: | |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7992/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 [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.74% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.19% <ø> (ø)` | | Carriedforward from [5de9bf9](https://app.codecov.io/gh/apache/texera/commit/5de9bf94766d441e7d1655bf326a9208dc6769a5?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/7992?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