-
Notifications
You must be signed in to change notification settings - Fork 21
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
Proof of concept integration tests cli client commands #32
Conversation
integration/client_crudl_test.go
Outdated
@@ -0,0 +1,95 @@ | |||
package main |
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.
package integration
3286bee
to
77b238a
Compare
You should be able to run the new tests in a $NAMESPACE
I think the old tests should still work fine, but I so far changed them to require explicit executable path.
I think that could be done better. |
integration/client_crudl_test.go
Outdated
func ValidMobileClientJson(name string, clientType string) func(output []byte, err error) (bool, []string) { | ||
return func(output []byte, err error) (bool, []string) { | ||
var parsed MobileClientJson | ||
errJson := json.Unmarshal([]byte(output), &parsed) |
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 can be shortened to if err := json.Unmarshal(); err != nil{ }
integration/client_crudl_test.go
Outdated
return false, []string{fmt.Sprintf("%s", err)} | ||
} | ||
if parsed.Spec.ClientType != clientType { | ||
return false, []string{fmt.Sprintf("Expected the ClientType to be %s, but got %s", clientType, parsed.Spec.ClientType)} |
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 think what we want here is a custom error type
type ClientJsonErr struct{
message string
clientType string
}
func (ce ClientJsonErr)Error()string{
return ce.message
}
func (ce ClientJsonErr)ClientType()string{
return ce.clientType
}
integration/validatedCommandUtils.go
Outdated
} | ||
|
||
type CmdDesc struct { | ||
executable 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.
Exec string
@AdamSaleh I am ok with this for now. I wouldn't call it idiomatic go, but there doesn't look to be anything particularly wrong with it. We may find we want to change and adjust things as time goes on and experience in Go grows, but for now it looks fine. I haven't verified it yet as I think @vchepeli was doing that. |
f832579
to
86e175c
Compare
Yay, if you are in oc project on your dev-setuped openshift, just running
now works :) |
Makefile
Outdated
integration: build |
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.
any reason why release is removed?
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.
one comment, lgtm otherwise
86e175c
to
8926b2d
Compare
8926b2d
to
c35e8b5
Compare
Describe what this PR does and why we need it:
As described in https://issues.jboss.org/browse/AEROGEAR-1860, we need to have integration tests.
Changes proposed in this pull request
To discuss
Does this PR depend on another PR (Use this to track when PRs should be merged)
Which issue this PR fixes (This will close that issue when PR gets merged)
fixes AEROGEAR-1860