Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests to use fallback exception to handle FieldError exception #539

Merged
merged 1 commit into from
May 25, 2024

Conversation

arhik
Copy link
Contributor

@arhik arhik commented May 23, 2024

with #54504 field access exception is raised as FieldError exception now.

@arhik
Copy link
Contributor Author

arhik commented May 23, 2024

JuliaLang/julia#54504 is not merged yet. So all tests will fail. But we need these for original PR. So how do we handle this ?

test/spqr.jl Outdated
@@ -39,7 +39,7 @@ itypes = sizeof(Int) == 4 ? (Int32,) : (Int32, Int64)
@test istriu(F.R)
@test isperm(F.pcol)
@test isperm(F.prow)
@test_throws ErrorException F.T
@test_throws FieldError F.T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@test_throws FieldError F.T
@test_throws Exception F.T

This will work both before and after #54504 (suggested by Eric Hanson on slack)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this temporary solution ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also do @test_throws Union{FieldError, ErrorException} F.T if we want to be a little more precise and only allow those 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. I didn't know we can do that. Thanks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do that Union because FieldError does not exist. We could do @test_throws isdefined(Base, :FieldError) ? FieldError : ErrorException F.T

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I should have tested on local PC first. I tested it this time.

@arhik arhik changed the title tests should use FieldError exception instead tests to use fallback exception to handle FieldError exception May 24, 2024
Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.73%. Comparing base (9d4397f) to head (f85748b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #539      +/-   ##
==========================================
- Coverage   84.07%   83.73%   -0.34%     
==========================================
  Files          12       12              
  Lines        9068     9046      -22     
==========================================
- Hits         7624     7575      -49     
- Misses       1444     1471      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

with PR#54504 field access exception is raised as `FieldError` exception now.
@LilithHafner
Copy link
Member

CI tests pass, though codecov upload fails. I see a similar pattern on other merged PRs. I'm assuming it's just the codecov setup being unreliable.

@LilithHafner LilithHafner merged commit 82b385f into JuliaSparse:main May 25, 2024
5 of 10 checks passed
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.

None yet

3 participants