-
Notifications
You must be signed in to change notification settings - Fork 25
Unit tests for init.go #24
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
Conversation
pkg/quarkus/v1alpha/init_test.go
Outdated
flagTest := pflag.NewFlagSet("testFlag", -1) | ||
// Need clarification on what to set ErrorHandlingNumber as |
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.
Some suggestions on what to put as the "default" ErrorHandlingNumber (currently -1) would be helpful.
pkg/quarkus/v1alpha/init_test.go
Outdated
testConfig, _ := config.New(config.Version{Number: 3}) | ||
// Need clarification on what to set Version number as |
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.
Here as well - suggestions on what to set as the version number would be helpful.
EDIT: Tested it out with a bunch of different values. 3 seems to be the only acceptable number.
Also, I did not write a test for the If you want me to dig into it and write a test for |
91c963f
to
e744bff
Compare
Everything is working perfect.
|
/lgtm |
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.
Update the test similar to the other PR comments.
pkg/quarkus/v1alpha/init_test.go
Outdated
successInitSubcommand := &initSubcommand{domain: "testDomain"} | ||
failureInitSubcommand := &initSubcommand{ | ||
domain: "testDomain", | ||
projectName: "?&fail&?", | ||
commandName: "failureTest", | ||
} |
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.
Put in a BeforeEach
block. that way each test has a fresh version that hasn't been affected by any changes from subsequent test.
pkg/quarkus/v1alpha/init_test.go
Outdated
Expect(failureInitSubcommand.commandName).NotTo(Equal(testCliMetadata.CommandName)) | ||
}) | ||
|
||
successInitSubcommand.UpdateMetadata(testCliMetadata, &testSubcommandMetadata) |
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.
Should be part of the It
e744bff
to
8ececbd
Compare
8ececbd
to
cfaf7e9
Compare
cfaf7e9
to
5536168
Compare
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
Added unit tests for v1alpha/init.go along with the suite tests for the v1 package.