Skip to content

test(amber): add unit tests for ErrorUtils#4709

Merged
aglinxinyuan merged 5 commits into
apache:mainfrom
Yicong-Huang:test-amber-error-utils
May 3, 2026
Merged

test(amber): add unit tests for ErrorUtils#4709
aglinxinyuan merged 5 commits into
apache:mainfrom
Yicong-Huang:test-amber-error-utils

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Adds scalatest coverage for amber/src/main/scala/org/apache/texera/amber/error/ErrorUtils.scala. The module had no dedicated spec.

Any related issues, documentation, discussions?

Closes #4708.

How was this PR tested?

sbt scalafmtCheckAll
sbt "WorkflowExecutionService/testOnly org.apache.texera.amber.error.ErrorUtilsSpec"

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

Generated-by: Claude Code (claude-opus-4-7)

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.88%. Comparing base (8cf5b9a) to head (80c669e).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4709      +/-   ##
============================================
- Coverage     42.85%   41.88%   -0.97%     
- Complexity     2027     2035       +8     
============================================
  Files           957      978      +21     
  Lines         34077    34569     +492     
  Branches       3753     3779      +26     
============================================
- Hits          14604    14480     -124     
- Misses        18692    19314     +622     
+ Partials        781      775       -6     
Flag Coverage Δ
access-control-service ?
amber 40.97% <ø> (+0.21%) ⬆️
computing-unit-managing-service ?
config-service ?
file-service ?
python 84.15% <ø> (+0.02%) ⬆️
workflow-compiling-service ?

Flags with carried forward coverage won't be shown. 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 a dedicated ScalaTest spec for ErrorUtils, improving unit-test coverage for Amber's shared error-handling helpers. It fits into the Amber backend by validating the formatting, wrapping, and reconstruction behavior used when surfacing runtime failures across worker/controller boundaries.

Changes:

  • Add a new ErrorUtilsSpec covering safely, mkConsoleMessage, and mkControlError.
  • Add reconstruction/formatting tests for reconstructThrowable and getStackTraceWithAllCauses.
  • Add worker-ID parsing tests for getOperatorFromActorIdOpt, including empty and fallback cases.

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

Closes apache#4708

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Yicong-Huang Yicong-Huang force-pushed the test-amber-error-utils branch from 71e630e to 92b795f Compare May 3, 2026 01:00
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) May 3, 2026 01:26
@aglinxinyuan aglinxinyuan merged commit 5a5ee19 into apache:main May 3, 2026
15 checks passed
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 unit tests for amber ErrorUtils

4 participants