Skip to content

refactor(parser): replace SubstraitError with TestCaseResult interface#234

Open
benbellick wants to merge 2 commits intomainfrom
refactor/testcase-result-type
Open

refactor(parser): replace SubstraitError with TestCaseResult interface#234
benbellick wants to merge 2 commits intomainfrom
refactor/testcase-result-type

Conversation

@benbellick
Copy link
Copy Markdown
Member

@benbellick benbellick commented Apr 15, 2026

SubstraitError held a free-form string that could be any value, but the
Substrait test case spec only defines two non-value outcomes: <!ERROR> and
<!UNDEFINED>. This replaces it with a sealed TestCaseResult interface and a
NonValueOutcome enum, making the valid states explicit at the type level.

I also added some docs :)


Note: This PR was developed with AI assistance. All changes have been reviewed, and I take full responsibility for this contribution.

SubstraitError was a struct with a free-form string field that could hold
arbitrary values. This replaces it with a sealed TestCaseResult interface
and a NonValueOutcome enum type with two constants matching the spec:
NonValueError (<!ERROR>) and NonValueUndefined (<!UNDEFINED>).

TestCase.Result is now a TestCaseResult, which is either a *CaseLiteral
for concrete values or a NonValueOutcome for error/undefined results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.82%. Comparing base (bdcbc17) to head (4f5f17e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
testcases/parser/nodes.go 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #234      +/-   ##
==========================================
- Coverage   68.84%   68.82%   -0.02%     
==========================================
  Files          47       47              
  Lines       10862    10859       -3     
==========================================
- Hits         7478     7474       -4     
- Misses       3030     3032       +2     
+ Partials      354      353       -1     

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benbellick benbellick marked this pull request as ready for review April 15, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant