[WIP] Introduce --namespace test flag and randomize test object names#3313
[WIP] Introduce --namespace test flag and randomize test object names#3313mgencur wants to merge 4 commits into
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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
mattmoor
left a comment
There was a problem hiding this comment.
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
mattmoor
left a comment
There was a problem hiding this comment.
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. |
mattmoor
left a comment
There was a problem hiding this comment.
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. DetailsInstructions 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. |
devguyio
left a comment
There was a problem hiding this comment.
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.
It seems the comment on line 46 was forgotten to be updated?
| 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.
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.
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.
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. DetailsInstructions 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