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
[CI] Randomize ns in policy tests #10180
Conversation
test-gke K8sPolicyTest* |
a4fb478
to
6f7a8c2
Compare
test-gke K8sPolicyTest* |
6f7a8c2
to
8ab8564
Compare
test-gke K8sPolicyTest* |
1 similar comment
test-gke K8sPolicyTest* |
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.
Basically LGTM. Some small questions but once you add the comments then we can merge if you want.
@@ -1336,8 +1337,8 @@ EOF`, k, v) | |||
demoPath string | |||
demoManifestNS1 string | |||
demoManifestNS2 string | |||
firstNS = "first" | |||
secondNS = "second" |
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.
We should be able to call helpers.GenerateNamespaceForTest
from here, no? Or are you worried that the timestamp will be wrong? (Would it matter, though? it just needs to be different than another test running and ginkgo will run the tests one-by-one no matter what)
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.
Running it here causes a segfault because ginkgo.CurrentGinkgoTestDescription()
returns nil
when run in Context
.
@@ -187,7 +187,7 @@ var _ = Describe("K8sPolicyTest", func() { | |||
} | |||
|
|||
BeforeAll(func() { | |||
namespaceForTest = helpers.GenerateNamespaceForTest() | |||
namespaceForTest = helpers.GenerateNamespaceForTest("") |
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.
Maybe the seed can be generated once at the beginning of all tests? Then it would definitely be unique between runs and callers don't need to remember which number to use in the seed if they change the tests.
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.
The seed is for making sure that if we have two namespaces (like in Clusterwide policies
context), we are sure that generated names will be different.
8ab8564
to
db817a1
Compare
test-gke K8sPolicyTest* |
test-me-please |
test-me-please |
2 similar comments
test-me-please |
test-me-please |
test-focus K8sPolicyTest* |
db817a1
to
2c6a7be
Compare
test-me-please |
test-gke K8sPolicyTest* |
Signed-off-by: Maciej Kwiek <maciej@isovalent.com>
2c6a7be
to
31392e3
Compare
test-gke K8sPolicyTest* |
test-focus K8sPolicyTest* |
This change is