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

Add JustAfterEach #1

Merged
merged 1 commit into from
Jun 5, 2018
Merged

Add JustAfterEach #1

merged 1 commit into from
Jun 5, 2018

Conversation

lwr20
Copy link
Owner

@lwr20 lwr20 commented May 31, 2018

What this PR does / why we need it:

In the kubernetes end to end tests (which use Ginkgo), the structure is that there is a general framework and then specific test cases. Both have BeforeEach and AfterEach statements and the execution order is

Framework BeforeEach
  Test BeforeEach
    Test runs
  Test AfterEach
Framework AfterEach.

Quite often, the Test's BeforeEach sets up some infrastructure required for the test and the AfterEach tears it down.

However, if a test fails, we want to collect diags as close to the failure as possible. We could find and modify all the innermost AfterEach's and add diags to them all. But it would be much nicer to be able to have a JustAfterEach in the Framework that all the tests use that works in a similar way to JustBeforeEach.

This problem was mentioned in kubernetes/kubernetes#34318, although that wasn't explicitly about this.

@lwr20 lwr20 self-assigned this May 31, 2018
@lwr20 lwr20 changed the title Add justAfterEach Add JustAfterEach Jun 5, 2018
Copy link
Collaborator

@fasaxc fasaxc left a comment

Choose a reason for hiding this comment

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

LGTM; probably will need docs updates to upstream

@lwr20 lwr20 merged commit a49113f into master Jun 5, 2018
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