Skip to content

test(workflow-operator): add unit test coverage for visualization option enums#6043

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:test-visualization-enums
Open

test(workflow-operator): add unit test coverage for visualization option enums#6043
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:test-visualization-enums

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Pin behavior of seven previously-untested visualization option enums in common/workflow-operator. No production-code changes.

Spec Source enum Tests
RadarPlotLinePatternSpec RadarPlotLinePattern 2
LineModeSpec LineMode 4
HierarchyChartTypeSpec HierarchyChartType 2
NormalizationTypeSpec NormalizationType 2
RangeSliderHandleDuplicateFunctionSpec RangeSliderHandleDuplicateFunction 2
ContourPlotColoringFunctionSpec ContourPlotColoringFunction 2
BoxViolinPlotQuartileFunctionSpec BoxViolinPlotQuartileFunction 2

Behavior pinned

Surface Contract
wire mapping each constant's @JsonValue string + constant counts
LineMode extras getModeInPlotly (lines/markers/lines+markers); @JsonCreator fromString case-insensitive + unknown-value rejection
Jackson round-trip serialize + deserialize back to the constant

Any related issues, documentation, discussions?

Part of the ongoing workflow-operator unit-test coverage effort.

How was this PR tested?

  • sbt "WorkflowOperator/testOnly *RadarPlotLinePatternSpec *LineModeSpec *HierarchyChartTypeSpec *NormalizationTypeSpec *RangeSliderHandleDuplicateFunctionSpec *ContourPlotColoringFunctionSpec *BoxViolinPlotQuartileFunctionSpec" — 16 tests, all green
  • sbt "WorkflowOperator/Test/scalafmtCheck" and sbt "WorkflowOperator/scalafixAll --check" — clean
  • CI to confirm

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

Generated-by: Claude Code (Opus 4.8 [1M context])

Copilot AI review requested due to automatic review settings July 1, 2026 01:25
@github-actions github-actions Bot added the common label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the common/workflow-operator test suite by adding unit tests that “pin” the JSON wire-format and Jackson round-trip behavior for several visualization option enums used by operators and UI/property-window configuration.

Changes:

  • Added ScalaTest specs to verify each enum constant’s @JsonValue mapping and expected constant count.
  • Added Jackson serialization/deserialization round-trip tests for each enum using the shared JSONUtils.objectMapper.
  • Added targeted tests for LineMode’s extra behaviors (getModeInPlotly and case-insensitive @JsonCreator fromString, including unknown-value rejection).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/rangeSlider/RangeSliderHandleDuplicateFunctionSpec.scala Pins wire values, enum size, and Jackson round-trip for the range slider duplicate-function enum.
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/radarPlot/RadarPlotLinePatternSpec.scala Pins wire values, enum size, and Jackson round-trip for radar plot line patterns.
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/lineChart/LineModeSpec.scala Adds coverage for LineMode wire mapping + Plotly mode translation + fromString behavior + Jackson round-trip.
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/histogram2d/NormalizationTypeSpec.scala Pins wire values, enum size, and Jackson round-trip for histogram2d normalization types.
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/hierarchychart/HierarchyChartTypeSpec.scala Pins wire values, enum size, and Jackson round-trip for hierarchy chart type selection.
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/contourPlot/ContourPlotColoringFunctionSpec.scala Pins wire values, enum size, and Jackson round-trip for contour plot coloring functions.
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/boxViolinPlot/BoxViolinPlotQuartileFunctionSpec.scala Pins wire values, enum size, and Jackson round-trip for box/violin quartile computation modes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

codecov-commenter commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6043      +/-   ##
============================================
- Coverage     56.93%   56.93%   -0.01%     
+ Complexity     3026     3025       -1     
============================================
  Files          1129     1129              
  Lines         43794    43794              
  Branches       4743     4743              
============================================
- Hits          24936    24934       -2     
- Misses        17384    17385       +1     
- Partials       1474     1475       +1     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø)
agent-service 44.59% <ø> (ø) Carriedforward from 434bcae
amber 58.75% <ø> (-0.02%) ⬇️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 52.30% <ø> (ø)
file-service 62.81% <ø> (ø)
frontend 50.12% <ø> (ø) Carriedforward from 434bcae
notebook-migration-service 78.57% <ø> (ø)
pyamber 90.20% <ø> (ø) Carriedforward from 434bcae
python 90.76% <ø> (ø) Carriedforward from 434bcae
workflow-compiling-service 55.14% <ø> (ø)

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 7 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main 434bcae benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 410 0.25 22,918/35,195/35,195 us 🔴 +19.1% / 🔴 +133.5%
🔴 bs=100 sw=10 sl=64 944 0.576 104,876/134,307/134,307 us 🔴 +5.4% / 🔴 +24.8%
bs=1000 sw=10 sl=64 1,090 0.665 921,644/955,630/955,630 us ⚪ within ±5% / 🟢 -9.7%
Baseline details

Latest main 434bcae from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 410 tuples/sec 449 tuples/sec 777.62 tuples/sec -8.7% -47.3%
bs=10 sw=10 sl=64 MB/s 0.25 MB/s 0.274 MB/s 0.475 MB/s -8.8% -47.3%
bs=10 sw=10 sl=64 p50 22,918 us 21,707 us 12,612 us +5.6% +81.7%
bs=10 sw=10 sl=64 p95 35,195 us 29,556 us 15,070 us +19.1% +133.5%
bs=10 sw=10 sl=64 p99 35,195 us 29,556 us 18,360 us +19.1% +91.7%
bs=100 sw=10 sl=64 throughput 944 tuples/sec 952 tuples/sec 988.31 tuples/sec -0.8% -4.5%
bs=100 sw=10 sl=64 MB/s 0.576 MB/s 0.581 MB/s 0.603 MB/s -0.9% -4.5%
bs=100 sw=10 sl=64 p50 104,876 us 103,340 us 101,066 us +1.5% +3.8%
bs=100 sw=10 sl=64 p95 134,307 us 127,372 us 107,594 us +5.4% +24.8%
bs=100 sw=10 sl=64 p99 134,307 us 127,372 us 115,830 us +5.4% +16.0%
bs=1000 sw=10 sl=64 throughput 1,090 tuples/sec 1,102 tuples/sec 1,019 tuples/sec -1.1% +6.9%
bs=1000 sw=10 sl=64 MB/s 0.665 MB/s 0.673 MB/s 0.622 MB/s -1.2% +6.9%
bs=1000 sw=10 sl=64 p50 921,644 us 908,151 us 986,982 us +1.5% -6.6%
bs=1000 sw=10 sl=64 p95 955,630 us 956,512 us 1,028,491 us -0.1% -7.1%
bs=1000 sw=10 sl=64 p99 955,630 us 956,512 us 1,058,493 us -0.1% -9.7%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,487.74,200,128000,410,0.250,22918.15,35194.86,35194.86
1,100,10,64,20,2117.71,2000,1280000,944,0.576,104875.58,134307.22,134307.22
2,1000,10,64,20,18346.69,20000,12800000,1090,0.665,921643.60,955629.68,955629.68

@aglinxinyuan aglinxinyuan requested a review from mengw15 July 1, 2026 04:55

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Yicong-Huang

Copy link
Copy Markdown
Contributor

does this PR improve test coverage? @aglinxinyuan. Seems that 300 lines of new tests add coverage on only 1 src line. Let's try to fill up the coverage on the untested code path first.

Screenshot 2026-07-01 at 1 02 58 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants