-
Notifications
You must be signed in to change notification settings - Fork 600
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
[WIP] Introduce --namespace test flag and randomize test object names #3313
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mgencur The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
/hold I'd like to try running the test suite with the flag enabled. |
/cc @lberk |
Hmm. I suppose limiting the length of namespace will require at least sub tests to have unique resource names so that they don't clash if they share the same namespace that is named according to the top-level test . Let's see. |
32b8b1e
to
ab68a85
Compare
Alright. Due to the length of some tests this is more complicated :-/ Right now, I'm not sure this is the right solution. |
wanna move this forward? |
I'm working on this. |
ab68a85
to
b85e4cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -name '*.pb.go' -prune -o -type f -name '*.go' -print)
goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)
Hey, this is a preview of the new impl which uses a common namespace for all tests. I've converted three top-level tests to this new approach and they pass when running in parallel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -name '*.pb.go' -prune -o -type f -name '*.go' -print)
goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party | grep -v .pb.go | grep -v wire_gen.go)
The following jobs failed:
Failed non-flaky tests preventing automatic retry of pull-knative-eventing-integration-tests:
|
@mgencur: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a nit comment, otherwise lgtm.
} | ||
|
||
// ToString converts the test case to a string to create names for different objects (e.g., triggers, services, etc.). | ||
func (tc eventTestCase) String() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the comment on line 46 was forgotten to be updated?
@@ -245,7 +251,7 @@ func TestBrokerWithManyTriggers(t *testing.T, brokerCreator BrokerCreator, shoul | |||
eventTrackers := make(map[string]*recordevents.EventInfoStore, len(test.eventFilters)) | |||
for _, event := range test.eventFilters { | |||
// Create event recorder pod and service | |||
subscriberName := "dumper-" + event.String() | |||
subscriberName := event.Name() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove the "dumper-"
prefix (and "trigger-"
one below)? Those common prefixes tend to help me establish the mental models when trying to debug a new (to me) test.
ninjaedit: maybe we can do something similar to your sender change? testlib.NameForTest("dumper-", even.Name())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it because the names need to be created in advance, and if I then prefix it with "dumper-" it may exceed the 63 limit, plus I'm getting segmentation faults because eventTrackers then don't include the right matcher and it calls a function on nil
object. Anyway, I'll see if we can improve it a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I'm facing a problem with running tests in parallel. Some of them label namespaces with knative-eventing-injection": "enabled"
and some of them don't want this. These tests can't run in parallel. Pretty complicated...
I'm putting this on hold becuase there are plans to start a new architecture for the whole test suite soon. It does not make sense to go ahead and invest time in the old infra. |
@mgencur: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This Pull Request is stale because it has been open for 90 days with |
This PR uses random names for test objects and makes it possible to use a common test namespace as opposed to a separate namespace for each test.
Fixes #2776
Proposed Changes
Release Note
Docs