-
Notifications
You must be signed in to change notification settings - Fork 187
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
Fix HelmChart values tests #332
Conversation
These tests fail for multiple reasons. First: Without changing Line 700 from Second: After changing to @arbourd is sure this works in their test environment. Could this be a problem with the unit test setup? I'm unable to find the reason :/ |
Please see my comment: #305 (comment) |
Eventually(func() bool { | ||
_ = k8sClient.Get(context.Background(), key, got) | ||
return got.Status.Artifact != nil && storage.ArtifactExist(*got.Status.Artifact) | ||
}, timeout, interval).Should(BeTrue()) | ||
f, err := os.Stat(storage.LocalPath(*got.Status.Artifact)) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(f.Size()).NotTo(BeZero()) | ||
Expect(got.Status.Artifact.Revision).To(Equal(updated.Status.Artifact.Revision)) |
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 do not think that this waits for the update to be processed, but instead just confirms the previous state. The best way to confirm the change has actually been processed before confirming state is likely to confirm the Status.ObservedGeneration
of got
has changed compared to updated
.
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.
Yes. I was thinking that might be the correct answer for the valid
tests as well, instead of Checksum
.
Expect(f.Size()).To(BeNumerically(">", 0)) | ||
helmChart, err := loader.Load(storage.LocalPath(*got.Status.Artifact)) | ||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(helmChart.Values["testOverride"]).To(BeTrue()) |
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.
testOverride
remains true because the invalid chart change does not break last working state.
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.
LGTM ✔️
Thank you @arbourd!
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.
LGTM as well, thanks a lot! 🌻
Can you please rebase?
Adds a test that loads the helmChart from the updated resource and verifies that `testOverride` (the value overrode in the test fixtures) changes from `false` to `true`. Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
Done @hiddeco. Thank you. 😌 |
Changes two tests that load the HelmChart from the updated resource and verifies that
testOverride
(the value overrode in the test fixtures) changes fromfalse
totrue
../charts/...
to./testdata/charts/...
(thank you @relu)updated
HelmChart, notchart
which is from some other test further up the spec (thank you @nniikkoollaaii)got.Status.Artifact.Checksum != updated.Status.Artifact.Checksum
"Creates artifacts with .tgz file"
because this tarball is never extracted (thank you @nniikkoollaaii). It was moved one step above to"Creates artifacts for"
which tests the revision changes oftestdata/chart/helmchart