-
Notifications
You must be signed in to change notification settings - Fork 423
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
Integration test framework #395
Integration test framework #395
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nckturner The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
why is this, do we need instance metadata for some reason? |
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 don't understand the cert loading changes otherwise lgtm
pkg/testutils/testserver.go
Outdated
t.Fatal(err) | ||
} | ||
|
||
if _, err := cfg.GetOrCreateCertificate(); err != nil { |
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.
where do these files get written? to pwd ?
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.
They get written to the "stateDir".
return cfg, errors.New("Invalid partition") | ||
} | ||
|
||
if errs := mapper.ValidateBackendMode(cfg.BackendMode); len(errs) > 0 { |
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.
is this and checking cfg.ClusterID necessary, shouldn't the server do these checks for us when you start it? when you call mapper.Start it should crap out if you provide an invalid one right?
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 calls ValidateBackendMode()
in cmd/aws-iam-authenticator/root.go
, so while I'm not sure if its strictly necessary for a test server, I'm just copying the getConfig()
function there.
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 would like to move BuildMapperChain()
from cmd to pkg, as I'm not using cmd in the integration tests at this point and I'd rather not. Maybe I can do the same for ValidateBackendMode()
.
I should say we need some type of AWS credentials for the initialization of the ec2Provider, if I remember correctly. Haven't looked too closely at the dependency yet though. |
815982f
to
0afdcd0
Compare
Framework to run integration tests: - Uses kubernetes integration test framework - Shallow clones k/k into a local directory for importing into tests to avoid complexity with generated code. - Adds a test which adds a config map entry and attempts to authenticate. - The test currently expects to be run on an EC2 instance because the authenticator server cannot start otherwise. I'd like to get rid of this dependency. - Makes config/certs and config/kubeconfig more testable, and adds pkg/testutils with helper functions to set up the test environment.
0afdcd0
to
08c6ce5
Compare
/lgtm |
Framework to run integration tests:
with generated code.