Skip to content

test(amber): cover email notification dispatch - #7191

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:test/email-notification-service
Aug 1, 2026
Merged

test(amber): cover email notification dispatch#7191
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:test/email-notification-service

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds focused unit coverage for email notification dispatch, suppression, and recovery from sender exceptions without requiring external infrastructure.

Any related issues, documentation, discussions?

Closes #7188

How was this PR tested?

  • WorkflowExecutionService/testOnly org.apache.texera.web.service.EmailNotificationServiceSpec — 3 passed.
  • WorkflowExecutionService/Test/scalafmtAll and WorkflowExecutionService/Test/scalafix
  • WorkflowExecutionService/Test/scalafmtCheck and WorkflowExecutionService/Test/scalafix --check

Mutation proof (each production change was reverted):

Production mutation Focused test result
Inverted the send predicate 3 failed
Replaced status-email dispatch with a no-op 2 failed
Removed exception recovery 1 failed

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

Generated-by: Codex (GPT-5)

@github-actions

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.

@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 31, 2026 23:56
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 0783470 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 532 0.325 17,775/24,944/24,944 us 🟢 -12.4% / 🔴 +54.0%
🔴 bs=100 sw=10 sl=64 1,015 0.62 95,931/129,048/129,048 us 🔴 +12.8% / 🔴 +16.5%
bs=1000 sw=10 sl=64 1,276 0.779 781,501/836,845/836,845 us ⚪ within ±5% / 🟢 +28.6%
Baseline details

Latest main 0783470 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 532 tuples/sec 550 tuples/sec 765.25 tuples/sec -3.3% -30.5%
bs=10 sw=10 sl=64 MB/s 0.325 MB/s 0.336 MB/s 0.467 MB/s -3.3% -30.4%
bs=10 sw=10 sl=64 p50 17,775 us 18,196 us 12,703 us -2.3% +39.9%
bs=10 sw=10 sl=64 p95 24,944 us 28,490 us 16,199 us -12.4% +54.0%
bs=10 sw=10 sl=64 p99 24,944 us 28,490 us 19,557 us -12.4% +27.5%
bs=100 sw=10 sl=64 throughput 1,015 tuples/sec 1,115 tuples/sec 965.22 tuples/sec -9.0% +5.2%
bs=100 sw=10 sl=64 MB/s 0.62 MB/s 0.68 MB/s 0.589 MB/s -8.8% +5.2%
bs=100 sw=10 sl=64 p50 95,931 us 86,249 us 103,830 us +11.2% -7.6%
bs=100 sw=10 sl=64 p95 129,048 us 114,449 us 110,778 us +12.8% +16.5%
bs=100 sw=10 sl=64 p99 129,048 us 114,449 us 118,713 us +12.8% +8.7%
bs=1000 sw=10 sl=64 throughput 1,276 tuples/sec 1,273 tuples/sec 992.33 tuples/sec +0.2% +28.6%
bs=1000 sw=10 sl=64 MB/s 0.779 MB/s 0.777 MB/s 0.606 MB/s +0.3% +28.6%
bs=1000 sw=10 sl=64 p50 781,501 us 783,981 us 1,016,959 us -0.3% -23.2%
bs=1000 sw=10 sl=64 p95 836,845 us 832,440 us 1,062,501 us +0.5% -21.2%
bs=1000 sw=10 sl=64 p99 836,845 us 832,440 us 1,082,611 us +0.5% -22.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,376.07,200,128000,532,0.325,17775.07,24943.53,24943.53
1,100,10,64,20,1970.07,2000,1280000,1015,0.620,95930.77,129047.76,129047.76
2,1000,10,64,20,15673.34,20000,12800000,1276,0.779,781500.69,836845.01,836845.01

@aglinxinyuan
aglinxinyuan marked this pull request as ready for review July 31, 2026 23:56
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.65%. Comparing base (348fa88) to head (3552a6a).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7191      +/-   ##
============================================
+ Coverage     80.58%   80.65%   +0.07%     
- Complexity     3890     3912      +22     
============================================
  Files          1162     1162              
  Lines         46264    46264              
  Branches       5153     5153              
============================================
+ Hits          37280    37314      +34     
+ Misses         7319     7276      -43     
- Partials       1665     1674       +9     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 348fa88
agent-service 77.42% <ø> (ø) Carriedforward from 348fa88
amber 75.79% <ø> (+0.20%) ⬆️
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 348fa88
config-service 65.97% <ø> (ø) Carriedforward from 348fa88
file-service 66.80% <ø> (ø) Carriedforward from 348fa88
frontend 83.22% <ø> (ø) Carriedforward from 348fa88
notebook-migration-service 78.89% <ø> (ø) Carriedforward from 348fa88
pyamber 97.36% <ø> (ø) Carriedforward from 348fa88
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from 348fa88

*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.

@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

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.

🟢 Ready to approve

The change set is test-only, aligns with the stated issue/PR goals, and the added tests directly exercise the key dispatch and recovery behaviors.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds focused ScalaTest unit coverage for EmailNotificationService in the Amber/web service layer, validating dispatch, suppression, and exception recovery paths without relying on external email infrastructure.

Changes:

  • Introduces a new EmailNotificationServiceSpec verifying that the exact workflow state is evaluated and (when allowed) dispatched.
  • Adds a suppression test ensuring sendStatusEmail is not invoked when shouldSendEmail declines.
  • Adds a recovery test ensuring exceptions from the notifier do not fail processEmailNotificationIfNeeded.
File summaries
File Description
amber/src/test/scala/org/apache/texera/web/service/EmailNotificationServiceSpec.scala Adds unit tests covering send, suppression, and exception recovery behavior for EmailNotificationService.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 1, 2026
Merged via the queue into apache:main with commit 91a036b Aug 1, 2026
26 of 32 checks passed
@aglinxinyuan
aglinxinyuan deleted the test/email-notification-service branch August 1, 2026 05:36
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.

Add tests for email notification dispatch

4 participants