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

Complex ExpectError handling functions #1015

Closed
wants to merge 5 commits into from

Conversation

obourdon
Copy link
Contributor

@obourdon obourdon requested a review from a team as a code owner July 28, 2022 06:34
@bflad bflad added breaking-change Implementation which breaks compatibility or other promises subsystem/tests Issues and feature requests related to the testing framework. enhancement New feature or request labels Jul 28, 2022
@bflad
Copy link
Contributor

bflad commented Aug 26, 2022

Hi @obourdon 👋 Thank you for submitting this.

In general, our preference for field types should always be to make them more type constrained, rather than less. Consumers encountering fields that accept any/interface{} are left without Go compiler help for their implementations and the additional burden to fully understand the implementation details of the underlying functionality by reading into the Go or website documentation further.

In this case, if we were to do anything here, the preference would be to create a new ErrorCheck func(error) error field at the TestStep level which mimics the existing behavior at the TestCase level. We'll also need to ensure there is covering unit testing of the expected behaviors. The testing framework validation logic can be augmented to raise an error if both ExpectError and ErrorCheck are defined in the same TestStep. If you're interested in that type of implementation, then let's discuss that further in the open issue or in a new pull request.

Thanks again.

@bflad bflad closed this Aug 26, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change Implementation which breaks compatibility or other promises enhancement New feature or request subsystem/tests Issues and feature requests related to the testing framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants