test(workflow-operator): add unit test coverage for visualization option enums#6043
test(workflow-operator): add unit test coverage for visualization option enums#6043aglinxinyuan wants to merge 1 commit into
Conversation
Automated Reviewer SuggestionsBased on the
|
There was a problem hiding this comment.
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
@JsonValuemapping 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 (getModeInPlotlyand 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 Report✅ All modified and coverable lines are covered by tests. 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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
| 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|
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.
|

What changes were proposed in this PR?
Pin behavior of seven previously-untested visualization option enums in
common/workflow-operator. No production-code changes.RadarPlotLinePatternSpecRadarPlotLinePatternLineModeSpecLineModeHierarchyChartTypeSpecHierarchyChartTypeNormalizationTypeSpecNormalizationTypeRangeSliderHandleDuplicateFunctionSpecRangeSliderHandleDuplicateFunctionContourPlotColoringFunctionSpecContourPlotColoringFunctionBoxViolinPlotQuartileFunctionSpecBoxViolinPlotQuartileFunctionBehavior pinned
@JsonValuestring + constant countsLineModeextrasgetModeInPlotly(lines/markers/lines+markers);@JsonCreator fromStringcase-insensitive + unknown-value rejectionAny related issues, documentation, discussions?
Part of the ongoing
workflow-operatorunit-test coverage effort.How was this PR tested?
sbt "WorkflowOperator/testOnly *RadarPlotLinePatternSpec *LineModeSpec *HierarchyChartTypeSpec *NormalizationTypeSpec *RangeSliderHandleDuplicateFunctionSpec *ContourPlotColoringFunctionSpec *BoxViolinPlotQuartileFunctionSpec"— 16 tests, all greensbt "WorkflowOperator/Test/scalafmtCheck"andsbt "WorkflowOperator/scalafixAll --check"— cleanWas this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])