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

MF-171: Replace argThat with eager failures #61

Open
wants to merge 2 commits into
base: jantonio/playlog_test_20
Choose a base branch
from

Conversation

stoyicker
Copy link
Member

@stoyicker stoyicker commented Jul 1, 2024

argThat is not descriptive enough for composite conditions.

Long story:

As you may have noticed, the tests that use a single verify call use argThat to look at the payload. If a test passes this works well and if it fails it's straightforward to figure out where the issue is - there's only one call and because we use assertions inside argThat we'll know exactly what failed, instead of returning a boolean and causing a situation where argThat would just print the whole String for every call, which has bonus problems for us since we only really care about the calls that are done for the playback_session name, but there are more than those for the same method and all of them will be printed out.

But for tests with more than one PlayLog event verification this approach does not work: we cannot use assertions inside argThat because that will prevent verifications from passing when written in an order different to that in which the corresponding calls are verified, and since we cannot guaranteed that order, relying on it is a no-no. We could use argThat as intended instead of with assertions and just return a boolean though, that works - but if the test fails, it becomes really hard to figure out which call failed and why.

This PR introduces a mechanism to tackle this issue.

@stoyicker stoyicker force-pushed the jantonio/combined_pass_allof branch 3 times, most recently from 36848eb to ee21d98 Compare July 1, 2024 18:52
@stoyicker stoyicker marked this pull request as ready for review July 1, 2024 18:52
@stoyicker stoyicker requested a review from a team as a code owner July 1, 2024 18:52
argThat is not descriptive enough for composite conditions.
@stoyicker stoyicker changed the title Replace argThat with eager failures MF-171: Replace argThat with eager failures Aug 30, 2024
@stoyicker stoyicker requested a review from a team September 4, 2024 11:03
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