-
Notifications
You must be signed in to change notification settings - Fork 40
add basic test framework for cmd line tests #498
Conversation
@surajssd I believe you need to do a vendor update to grab that one package you added 👍 |
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.
Code LGTM, I just need to run-through and test this.
tests/cmd/cmd_test.go
Outdated
} | ||
|
||
func runCmd(t *testing.T, args []string) (string, error) { | ||
cmd := exec.Command("kedge", args...) |
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.
might be good to make kedge
a global variable just-in-case we port this code to another project (hint: kompose, haha)
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.
done
1a322b2
to
e869e69
Compare
tests/cmd/cmd_test.go
Outdated
}{ | ||
{ | ||
name: "multiple configmaps given and name not specified", | ||
command: []string{"generate", "-f=" + Fixtures + "multi-configmapname/app.yaml"}, |
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 just generates an all the files are always in Fixtures
dir.
It would be more readable to specify just file/dir path.
testCases := []struct {
name string
path string
input string
wantSuccess bool
error string
}{
{
name: "multiple configmaps given and name not specified",
path: "multi-configmapname/app.yaml"
...
proper command can be build inside for loop before test is run
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.
done!
8fb9002
to
2d0cd9c
Compare
2d0cd9c
to
60c048b
Compare
60c048b
to
d67059e
Compare
d67059e
to
451f30d
Compare
No description provided.