Skip to content

Clean up how the test framework creates asserting scorables. #14452

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Apr 7, 2025

This removes the WrappedScorer class and uses the existing AssertingScorer class instead.

This removes the `WrappedScorer` class and uses the existing `AssertingScorer`
class instead.
Copy link
Contributor

@jainankitk jainankitk left a comment

Choose a reason for hiding this comment

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

The refactoring looks good, even cleans up some unused code like AssertingScorer#random. Minor comment to understand it better

Comment on lines -83 to +78
assert scoreMode == ScoreMode.TOP_SCORES;
assert canCallMinCompetitiveScore;
assert canScore;
assert canSetMinCompetitiveScore;
Copy link
Contributor

Choose a reason for hiding this comment

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

Still trying to understand this code better, but it seems that the assertion statement is weaker now. Earlier, it was specifically scoreMode == ScoreMode.TOP_SCORES, and now it is scoreMode.needsScores(). Do we allow it for other scoreMode that needsScores now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good point, I pushed a commit that makes sure setMinCompetitiveScore may only be called with TOP_SCORES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants