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

feat: Added negative log assertions #154

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

amarsjac
Copy link
Contributor

@amarsjac amarsjac commented Sep 25, 2024

What was the problem/requirement? (What/Why)

Negative case for log assertion does not exist. Test fixtures do not have easy way to assert that something is not in logs.

What was the solution? (How)

Add method to check for non-presence. Method works by doing an immediate check if expected_pattern finds a match within logs. Then a wait is used to account for eventual consistency of logs before checking again (default 3 seconds). If the second check also finds no match then the pattern is assumed to not exist in the logs.
In the case that the wait time is set to 0 or less, only 1 check is performed, and a warning indicating such is emitted to the logger.
Like the preceding positive log assertion method this new methods assumes a single step, single task log.
Also abstracted out common code to reduce code duplication

What is the impact of this change?

A consistent user experience for checking logs of simple jobs.

How was this change tested?

Unit tests written to check new test functionality

Was this change documented?

#153

Is this a breaking change?

no

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@amarsjac amarsjac force-pushed the negative_log_assertion branch 12 times, most recently from 2443791 to 841df36 Compare September 26, 2024 19:23
erico-aws
erico-aws previously approved these changes Oct 7, 2024
Signed-off-by: Marshall Jackson <[email protected]>
Copy link

sonarcloud bot commented Oct 8, 2024

@amarsjac amarsjac merged commit d75f580 into aws-deadline:mainline Oct 11, 2024
15 checks passed
@amarsjac amarsjac deleted the negative_log_assertion branch October 11, 2024 13:20
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.

3 participants