-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
make failing test showing spurious variable conflicts #1634
Conversation
/assign @monopole |
Not sure I went as far as you'd like with the functional "sugar" for the tests @monopole, but I tried to clean it up in a way that I felt would be much more readable for future maintainers. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tkellen The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
643fcd6
to
d851305
Compare
|
||
func makeVarToNamepaceAndPath( | ||
name string, | ||
namespace string, |
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.
namespace isn't used, did you mean env?
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.
Whoops. No, I did mean to use it, though clearly it isn't strictly required I felt it helped illustrate my particular incarnation of this issue. I've updated this.
} | ||
} | ||
|
||
func TestResolveVarConflicts(t *testing.T) { |
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.
this test reads like an example, which is perfect. thanks!
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.
My pleasure, thanks for prompting me to take a bit more care.
// value do not produce a conflict. | ||
err := ac0.MergeAccumulator(ac1) | ||
if err != nil { | ||
t.Fatalf("dupe var names w/ same concrete val should not conflict: %v", err) |
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.
so the current form of this test should be
if err == nil {
t.Fatalf("see bug whatever")
}
the subsequent PR to fix that bug should change this line.
we cannot check in failing tests, but we can check in tests that succeed showing behavior we want to change
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.
Got it. Updated this and the now-dependent PR.
Per @monopole's request in https://github.com/kubernetes-sigs/kustomize/pull/1620/files#r334282443, this PR isolates a failing test for gh-1600.