Test case for issue 4012 pkg update not updating kptfile #4030
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a test-case for
kpt pkg get/update
that reproduce the issue reported in #4012Note: Since this is a failing test-case it could be considered to disable the final and failing assertion until the problem have been resolved
This PR adds a
Kptfile
todataset1
anddataset2
for the sub packagemysql
. The change betweendataset1
anddataset2
are:The test-case basically does a
kpt pkg get mysql@dataset1
followed by akpt pkg update mysql@dataset2
and verifies the content ofKptfile
. The issue from #4012 thus results in a test-case failure with the following diff between the localKptfile
vsdataset2
(i.e. the local version have 'removals' compared todataset2
because the localKptfile
is not properly updated todataset2
):Note, a copy of the
Kptfile
fromdataset2
have also been added todataset4
anddataset5
since these are 'clones' ofdataset2
.This PR also correct an issue in
testutil.AssertKptfile
related to sequence-nodes (this new test-case seems to be the first use of sequence-nodes inKptfile
s). The issue is, thatkptfileutil.WriteFile()
use encoder optionyaml.WideSequenceStyle
, while the encoding used intestutil.AssertKptfile
is a compact encoding. Without this correction, the test-case would fail with additional whitespace differences, e.g. (this is the initialpkg get
verification ofdataset1
that fails):