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

tests: AllOf failing immediately if fail-fast #5673

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/e2e/funcs/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,18 @@ const DefaultPollInterval = time.Millisecond * 500

type onSuccessHandler func(o k8s.Object)

// AllOf runs the supplied functions in order.
// AllOf runs the supplied functions in order. If a function fails the test and
// the environment is configured to fail fast (e2e-framework's -fail-fast flag)
Copy link
Member

Choose a reason for hiding this comment

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

looks like we are specifying the intent to fail fast with -test.failfast -fail-fast in the e2e step https://github.com/crossplane/crossplane/blob/master/.github/workflows/ci.yml#L306C47-L306C72 - were you able to also verify that the flag is making it down into this testing context correctly?

Copy link
Contributor Author

@phisco phisco May 10, 2024

Choose a reason for hiding this comment

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

yes, in our specific case, we do build our environment from flags, whether another user will pass down that correctly it's up to the user.

// the remaining functions will not be run.
func AllOf(fns ...features.Func) features.Func {
return func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
t.Helper()

for _, fn := range fns {
ctx = fn(ctx, t, c)
if t.Failed() && c.FailFast() {
break
}
}
return ctx
}
Expand Down
Loading