Skip to content

test(frontend): rewrite sync-texera-model spec#5194

Merged
Yicong-Huang merged 2 commits into
apache:mainfrom
Yicong-Huang:test/sync-texera-model-spec-rewrite
May 24, 2026
Merged

test(frontend): rewrite sync-texera-model spec#5194
Yicong-Huang merged 2 commits into
apache:mainfrom
Yicong-Huang:test/sync-texera-model-spec-rewrite

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang commented May 24, 2026

What changes were proposed in this PR?

sync-texera-model.spec.ts was carrying ~344 lines of dead test code: four it() blocks commented out against a SyncTexeraModel constructor that took an OperatorGroup third argument. OperatorGroup was removed from the codebase long ago, the constructor is now two-arg, and SyncTexeraModel no longer handles operator-delete events at all — so each commented test depended on a class that doesn't exist and exercised behavior that's been moved elsewhere. One nearby live test claimed to assert the operator-delete error path but never instantiated the SUT and made no assertions; it was vacuous.

Drop the four commented blocks, their preceding doc blocks, the vacuous live test, and the now-orphaned getJointOperatorValue helper. Add a describe("getOperatorLink", …) that hits the static helper's two throw branches directly — the stream-handler tests can't reach them because isValidJointLink filters those cases out upstream.

Any related issues, documentation, discussions?

Closes #5193.

How was this PR tested?

yarn ng test --watch=false --include=… runs 9 tests, all green. yarn lint and yarn format:ci both clean. v8 line coverage of sync-texera-model.ts rises from 94 % (31/33) to 100 % (33/33); the spec itself shrinks 747 → 449 lines.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

The spec carried four commented-out `it()` blocks at lines 148, 200,
602, and 687, each calling a three-argument `SyncTexeraModel`
constructor that took an `OperatorGroup` as the third dependency.
`OperatorGroup` has long been removed from the codebase, the
constructor is now two-arg, and `SyncTexeraModel` itself no longer
handles operator-delete events at all — every commented test depended
on a dependency that's gone and tested a responsibility that's been
refactored elsewhere. A nearby live test ("should explicitly throw an
error if the JointJS operator delete event deletes a nonexist
operator") was vacuous: its body never instantiated the SUT and
asserted nothing.

Drop the four commented blocks, their preceding doc blocks, the
vacuous live test, and the now-orphan `getJointOperatorValue` helper.
Add a `describe("getOperatorLink", …)` block that exercises the two
`throw` branches inside the static helper, which the stream-handler
tests can't reach because `isValidJointLink` filters those cases out
upstream. SUT coverage rises from 94 % (31/33) to 100 % (33/33); the
spec shrinks 747 → 449 lines.

Closes apache#5193
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 24, 2026
@Yicong-Huang Yicong-Huang changed the title test(frontend): rewrite sync-texera-model spec for full SUT coverage test(frontend): rewrite sync-texera-model spec May 24, 2026
Prettier's 120-char printWidth wraps the `expect().toThrow()` lines
once the SUT name is the longer `SyncTexeraModel.getOperatorLink`.
My earlier local format check piped through `tail`, which masked
prettier-eslint's non-zero exit; CI caught it. No behaviour change.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.38%. Comparing base (cbe90c7) to head (a140537).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5194      +/-   ##
============================================
+ Coverage     45.25%   45.38%   +0.12%     
  Complexity     2216     2216              
============================================
  Files          1042     1042              
  Lines         39989    39989              
  Branches       4260     4260              
============================================
+ Hits          18099    18149      +50     
+ Misses        20770    20721      -49     
+ Partials       1120     1119       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from cbe90c7
agent-service 33.76% <ø> (ø) Carriedforward from cbe90c7
amber 45.71% <ø> (ø) Carriedforward from cbe90c7
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from cbe90c7
config-service 0.00% <ø> (ø) Carriedforward from cbe90c7
file-service 32.18% <ø> (ø) Carriedforward from cbe90c7
frontend 37.81% <ø> (+0.31%) ⬆️
python 90.50% <ø> (ø) Carriedforward from cbe90c7
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from cbe90c7

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Yicong-Huang Yicong-Huang requested a review from aglinxinyuan May 24, 2026 23:27
@Yicong-Huang Yicong-Huang added this pull request to the merge queue May 24, 2026
Merged via the queue into apache:main with commit 8633188 May 24, 2026
16 checks passed
@Yicong-Huang Yicong-Huang deleted the test/sync-texera-model-spec-rewrite branch May 24, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sync-texera-model.spec carries 4 dead commented-out tests and misses 2 error branches

3 participants