Skip to content

Comments

File injection test using fakekubeclient#861

Merged
ivan4th merged 1 commit intomasterfrom
jell/fit
Feb 14, 2019
Merged

File injection test using fakekubeclient#861
ivan4th merged 1 commit intomasterfrom
jell/fit

Conversation

@jellonek
Copy link
Contributor

@jellonek jellonek commented Feb 7, 2019

This change is Reviewable

Copy link
Contributor

@ivan4th ivan4th left a comment

Choose a reason for hiding this comment

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

Some thoughts... We have vmconfig loading from fakekubeclient already tested. So we can for sure keep this test case, but what about also adding a test case here

// TODO: add test cases for rootfs / persistent rootfs file injection
(it would signal file injection breakage that's not due to a problem with kubeclient), and also, in the same place, a test case for persistent rootfs file injection?

Reviewable status: 0 of 1 approvals obtained

@jellonek
Copy link
Contributor Author

I'm not fully sure how you would add that. Are you suggesting to add to struct in

for _, tc := range []struct {
additional field for parameters needed by fake kube client as in https://github.com/Mirantis/virtlet/pull/861/files#diff-1fd8fde46fcffd8abd9ee1c4e043e6beR296 and basically rest of the lines from this test case before
ct.setPodSandbox(sandbox)
line for testcases with non nil values for fake kube client parameters?
That would do the job, but would imo unnecessary enlarge already long body of
t.Run(tc.name, func(t *testing.T) {
loop.
Hmmm... I can refactor that a bit to make it more readable adding also handling this extension to tc struct.

@jellonek
Copy link
Contributor Author

PR updated according to suggestion.

Copy link
Contributor

@ivan4th ivan4th left a comment

Choose a reason for hiding this comment

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

Well my idea was to have TestDomainDefinitions cases w/o using the defaultExternalDataLoader and passing in a pre-filled VMConfig instead. What you did is probably even better, but doesn't it make TestFileInjectionHandlingDuringContainerCreation redundant, as it does basically the same thing?

Reviewable status: 0 of 1 approvals obtained

@jellonek
Copy link
Contributor Author

In fact it does. Ok, removed.

Copy link
Contributor

@ivan4th ivan4th left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r2.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@ivan4th ivan4th merged commit 732c43b into master Feb 14, 2019
@ivan4th ivan4th deleted the jell/fit branch February 14, 2019 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants