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

OrtResultTest improvements #8555

Merged
merged 4 commits into from
Apr 23, 2024
Merged

OrtResultTest improvements #8555

merged 4 commits into from
Apr 23, 2024

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented Apr 23, 2024

See individual commits.

Context: #7921.

@fviernau fviernau requested a review from a team as a code owner April 23, 2024 08:14
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.68%. Comparing base (d53ac0b) to head (0f202dd).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8555   +/-   ##
=========================================
  Coverage     67.68%   67.68%           
  Complexity     1006     1006           
=========================================
  Files           246      246           
  Lines          7924     7924           
  Branches        883      883           
=========================================
  Hits           5363     5363           
  Misses         2181     2181           
  Partials        380      380           
Flag Coverage Δ
funTest-docker 65.35% <ø> (ø)
test 37.55% <ø> (ø)

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.

with(openIssues.first()) {
message shouldBe "Non-resolved issue"
}
openIssues.map { it.message }.shouldContainExactly("Non-resolved issue")
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Closer to the original semantics would be shouldHaveSingleElement (which also does not take a vararg and thus has an infix version).

Copy link
Member Author

Choose a reason for hiding this comment

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

shouldHaveSingleElement "Non-resolved issue" has the exact same semantics as .shouldContainExactly("Non-resolved issue"), doesn't it?

Changing it anyway, as shouldHaveSingleElement is a slight abbrevation.

Copy link
Member

Choose a reason for hiding this comment

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

shouldHaveSingleElement "Non-resolved issue" has the exact same semantics as .shouldContainExactly("Non-resolved issue"), doesn't it?

shouldContainExactly alone does not have the same semantics as shouldHaveSingleElement, you also need to take the amount of parameters into account to match semantics. In other words, shouldHaveSingleElement better expresses that you're never expecting there to be more than a single element.

@fviernau fviernau requested a review from sschuberth April 23, 2024 09:44
Re-align the name with the renamed functions.

Signed-off-by: Frank Viernau <[email protected]>
Align with the tests for `getOpenIssues()`, so that AAA pattern
remains visible.

Signed-off-by: Frank Viernau <[email protected]>
Simplify the tests by testing one thing at a time.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the ort-result-test-improvements branch from 0125ab8 to 0f202dd Compare April 23, 2024 09:50
@fviernau fviernau enabled auto-merge (rebase) April 23, 2024 09:50
@fviernau fviernau disabled auto-merge April 23, 2024 10:42
@fviernau fviernau merged commit 1b00fae into main Apr 23, 2024
21 of 22 checks passed
@fviernau fviernau deleted the ort-result-test-improvements branch April 23, 2024 10:42
@fviernau
Copy link
Member Author

Failing tests were unrelated.

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.

2 participants