Skip to content

test(workflow-core): add unit test coverage for storage-model classes#6095

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test-core-storage-models
Jul 4, 2026
Merged

test(workflow-core): add unit test coverage for storage-model classes#6095
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test-core-storage-models

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Add unit test coverage for three common/workflow-core storage-model classes, selected from the Codecov report (all 0%). No production-code changes.

File Codecov before What the tests pin
ResultSchema.scala 0% the runtime-statistics schema's 11 columns (names + types, in order) and the single-column console-messages schema
ReadonlyLocalFileDocument.scala 0% URI/file accessors and input-stream read against a local temp file, plus each unsupported collection accessor throwing its exact message
VirtualDocument.scala 6.2% every default method (read/write/file/stat) throws NotImplementedError with its exact message, via a minimal concrete subclass

Any related issues, documentation, discussions?

Follow-up to the review feedback on #6043: prioritize tests that fill uncovered code paths.

How was this PR tested?

  • sbt "WorkflowCore/testOnly *ResultSchemaSpec *ReadonlyLocalFileDocumentSpec *VirtualDocumentSpec" — 20 tests, all green
  • sbt "WorkflowCore/Test/scalafmtCheck" and sbt "WorkflowCore/scalafixAll --check" — clean

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

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

Targets Codecov-missed lines (all 0%): ResultSchema (schema column names/types),
ReadonlyLocalFileDocument (URI/file/stream accessors + unsupported-op throws, via temp file),
and VirtualDocument (every default method throws NotImplementedError with its exact message).
Copilot AI review requested due to automatic review settings July 4, 2026 06:42
@github-actions github-actions Bot added the common label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 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 adds ScalaTest unit coverage in common/workflow-core for previously-uncovered storage-model/result-schema classes, without changing production code. The new specs pin schema column order/types and document behavior (including default/unsupported method error messages).

Changes:

  • Add unit tests for ResultSchema runtime-statistics and console-messages schemas.
  • Add unit tests for ReadonlyLocalFileDocument URI/file accessors, input-stream reads, and unsupported iterator APIs.
  • Add unit tests for VirtualDocument default method behavior (expected NotImplementedError messages) via a minimal concrete subclass.

Reviewed changes

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

File Description
common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/result/ResultSchemaSpec.scala Pins ResultSchema attribute names (order) and attribute types for the two exported schemas.
common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/model/VirtualDocumentSpec.scala Verifies default VirtualDocument methods throw NotImplementedError with exact messages using a minimal concrete implementation.
common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/model/ReadonlyLocalFileDocumentSpec.scala Verifies read-only local file document accessors, stream reading, and unsupported collection accessors’ exact error messages.

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

@codecov-commenter

codecov-commenter commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.60%. Comparing base (186115d) to head (a50c392).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6095      +/-   ##
============================================
+ Coverage     58.17%   58.60%   +0.42%     
- Complexity     3144     3204      +60     
============================================
  Files          1132     1132              
  Lines         43674    43674              
  Branches       4734     4734              
============================================
+ Hits          25407    25594     +187     
+ Misses        16831    16657     -174     
+ Partials       1436     1423      -13     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø)
agent-service 44.59% <ø> (ø) Carriedforward from 8f30369
amber 61.82% <ø> (+1.11%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 52.30% <ø> (ø)
file-service 62.81% <ø> (ø)
frontend 51.31% <ø> (ø) Carriedforward from 8f30369
notebook-migration-service 78.57% <ø> (ø)
pyamber 91.15% <ø> (ø) Carriedforward from 8f30369
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 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main a3f22bb 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 377 0.23 26,409/37,178/37,178 us 🔴 +21.3% / 🔴 +142.5%
🔴 bs=100 sw=10 sl=64 915 0.558 107,275/145,437/145,437 us 🔴 -5.3% / 🔴 +34.2%
bs=1000 sw=10 sl=64 1,081 0.66 920,632/1,008,083/1,008,083 us ⚪ within ±5% / 🟢 -7.3%
Baseline details

Latest main a3f22bb from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 377 tuples/sec 424 tuples/sec 772.08 tuples/sec -11.1% -51.2%
bs=10 sw=10 sl=64 MB/s 0.23 MB/s 0.259 MB/s 0.471 MB/s -11.2% -51.2%
bs=10 sw=10 sl=64 p50 26,409 us 21,763 us 12,745 us +21.3% +107.2%
bs=10 sw=10 sl=64 p95 37,178 us 34,082 us 15,330 us +9.1% +142.5%
bs=10 sw=10 sl=64 p99 37,178 us 34,082 us 19,054 us +9.1% +95.1%
bs=100 sw=10 sl=64 throughput 915 tuples/sec 964 tuples/sec 982.64 tuples/sec -5.1% -6.9%
bs=100 sw=10 sl=64 MB/s 0.558 MB/s 0.589 MB/s 0.6 MB/s -5.3% -7.0%
bs=100 sw=10 sl=64 p50 107,275 us 102,132 us 101,961 us +5.0% +5.2%
bs=100 sw=10 sl=64 p95 145,437 us 139,853 us 108,335 us +4.0% +34.2%
bs=100 sw=10 sl=64 p99 145,437 us 139,853 us 114,379 us +4.0% +27.2%
bs=1000 sw=10 sl=64 throughput 1,081 tuples/sec 1,097 tuples/sec 1,013 tuples/sec -1.5% +6.7%
bs=1000 sw=10 sl=64 MB/s 0.66 MB/s 0.67 MB/s 0.618 MB/s -1.5% +6.7%
bs=1000 sw=10 sl=64 p50 920,632 us 918,324 us 993,573 us +0.3% -7.3%
bs=1000 sw=10 sl=64 p95 1,008,083 us 961,176 us 1,032,489 us +4.9% -2.4%
bs=1000 sw=10 sl=64 p99 1,008,083 us 961,176 us 1,065,526 us +4.9% -5.4%
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,529.90,200,128000,377,0.230,26408.79,37178.45,37178.45
1,100,10,64,20,2186.36,2000,1280000,915,0.558,107274.52,145437.36,145437.36
2,1000,10,64,20,18499.91,20000,12800000,1081,0.660,920631.69,1008083.20,1008083.20

- ReadonlyLocalFileDocument: use the StandardCharsets.UTF_8 Charset overload instead of a
  stringly-typed charset name
- VirtualDocument: assert URI and clear() on a single shared instance
@aglinxinyuan aglinxinyuan added this pull request to the merge queue Jul 4, 2026
Merged via the queue into apache:main with commit bc5accf Jul 4, 2026
23 checks passed
@aglinxinyuan aglinxinyuan deleted the test-core-storage-models branch July 4, 2026 08:17
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.

4 participants