Skip to content

Conversation

@stlaz
Copy link
Collaborator

@stlaz stlaz commented May 27, 2025

The e2e tests in the current form are super hard to review whenever there are some new moves.
A huge part of why this is so hard is the super impractical use of YAML files for each test.

This PR creates a new kubetest.Action that allows moving the test config into the test file rather
than having to follow filenames and trying to eye where one YAML diffs from another.


I am building this PR on top sig-auth-acceptance branch but will cherry-pick it once (if) it merges.

@stlaz stlaz requested a review from ibihim May 27, 2025 14:55
@stlaz stlaz added the sig-auth-acceptance issues created during review for sig-auth-acceptance label May 27, 2025
@stlaz stlaz force-pushed the e2e-rework branch 3 times, most recently from 6880e0f to 132f339 Compare May 28, 2025 10:04
return 200 'metrics endpoint reached\n';
}
}
`
Copy link
Collaborator

Choose a reason for hiding this comment

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

What I don't like the most is that we have a nginx config as string here and in identityheaders/{secure,default}/configmap-nginx.yaml. I prefer to have them as a dedicated file and NOT as string in here.

In a perfect world upstream and potentially the client would have their own builders as well, with this nice file-reading like with the templates, but I think this would be too far-stretched... yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree it's not ideal. If we'd like an nginx config builder, we can do it in a follow-up.

For now I like that you don't need to look in a different file to see this simple, default config.

verb: get
path: /metrics
`

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here, I am a little less strongly against it, but I would prefer to have it in a dedicated file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Being able to see the config right away in the same file seems valuable to me.

AddUserClusterRoleBinding("test-client", testtemplates.GetMetricsRoleForClient()).
WithClientCerts("test-client").
UpdateFlags(map[string]string{"client-ca-file": "/var/run/configMaps/test-client-trust/ca.crt"})
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You want to ensure to not reuse certs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we need to

limitations under the License.
*/

package testtemplates
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really really like this file. We could actually use this to read all the files that we have, not just the templates 😄

limitations under the License.
*/

package kubetest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some of the lines in this file are very very long.

return c
}

func (c *KRPTestConfig) Launch(client kubernetes.Interface) Action {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Uf, this is rather long and mostly the same pattern:

  • create resource,
  • add to deployment,
  • and defer cleanup.

Not sure though if it makes sense to rework this as this PR is already very big.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree it's a bit unfortunate. As I was writing this, I realized that this would probably have to be that one function that everybody hates but just deals with it.

We can try to do something with it in a follow-up.

As this PR shows, we really should wire context through in many places through the tests, perhaps that can be done along with it.

@ibihim
Copy link
Collaborator

ibihim commented Oct 1, 2025

/lgtm

lets merge as is

@ibihim ibihim merged commit 05196bb into brancz:sig-auth-acceptance Oct 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig-auth-acceptance issues created during review for sig-auth-acceptance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants