Skip to content

Running tests without calling environment.InitFlags() func leads to failed test being skipped instead of failure #268

@cardil

Description

@cardil

The environment.InitFlags() is required to be executed. Without it, the flags are not set properly. Their values are outside of possible known values - s == 0 and l == 0.

https://github.com/knative-sandbox/reconciler-test/blob/816f2192fec9b6363c2b9ed79875aa54d472eede/pkg/environment/flags.go#L29-L30

This leads to nasty behavior - the shouldFail(s *feature.Step) bool func returns false, and instead of failures, the tests are skipped. This behavior is hard to understand.

https://github.com/knative-sandbox/reconciler-test/blob/816f2192fec9b6363c2b9ed79875aa54d472eede/pkg/environment/magic.go#L306-L309

I think, we should amend the test framework to ensure flags have valid values. Either by forcing people to call environment.InitFlags(), or setting flag values with reasonable defaults.

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.triage/acceptedIssues which should be fixed (post-triage)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions