-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
more test coverage for generate/app #13892
Conversation
[test] |
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.
A few nits, but mostly looks good. Thanks for doing this!
pkg/generate/app/app_test.go
Outdated
@@ -14,6 +14,7 @@ import ( | |||
imageapi "github.com/openshift/origin/pkg/image/api" | |||
|
|||
_ "github.com/openshift/origin/pkg/api/install" | |||
"strings" |
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 should go up to other core imports.
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 realized I left that in there last night and knew you'd call it out 😄 You're so predictable, @soltysh. I should've left some long ifs in there too.
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.
You know me 🚔
pkg/generate/app/app_test.go
Outdated
val string | ||
expectedReturn bool | ||
}{ | ||
{"foo", false}, |
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.
Add a comment that you're testing parents inside of the for loop, otherwise someone might miss that there.
{"$foo}", false}, | ||
{"foo}", false}, | ||
{"{foo", false}, | ||
{"${foo", true}, |
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.
Sigh... this makes me 😢, why we allow this? Is it for supporting spaces inside of those or what? @bparees
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 have no idea. @smarterclayton coded IsParameterizableValue, let's ask him.
but it should not be for supporting spaces, regex would handle that. I think it's just a lazy check.
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 someone can do
oc new-app ruby --name='${name}' -o yaml
And get something they can create a template from
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 don't think that's the question. The question is why the check doesn't look for/require a closing brace.
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.
That's exactly my question, currently we're only looking for opening bracket but no accompanying closing one.
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've spawned #13994 to address this.
pkg/generate/app/builder_test.go
Outdated
"testing" | ||
|
||
imageapi "github.com/openshift/origin/pkg/image/api" | ||
"reflect" |
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.
Again, up with the core imports.
t.Fatalf("failed parsing empty host url: %v", err) | ||
} | ||
|
||
hostPortURL, err := url.Parse("https://www.example.com:80") |
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.
how about a non-standard port?
pkg/generate/app/builder_test.go
Outdated
}, | ||
expectedReturn: true, | ||
}, | ||
"has legacy envrionment STI_LOCATION": { |
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.
environment
pkg/generate/app/builder_test.go
Outdated
}, | ||
expectedReturn: true, | ||
}, | ||
"has legacy envrionment STI_BUILDER": { |
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.
environment
pkg/generate/app/builder_test.go
Outdated
}, | ||
expectedReturn: true, | ||
}, | ||
"has legacy envrionment STI_SCRIPTS_URL": { |
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.
environment
[test] |
LGTM |
[test] |
re[test] |
1 similar comment
re[test] |
[test] |
Evaluated for origin test up to 1c8795c |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1483/) (Base Commit: b96ef9a) |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1483/) (Base Commit: b96ef9a) (Image: devenv-rhel7_6232) |
Evaluated for origin merge up to 1c8795c |
@soltysh related but does not completely resolve #3016
Added some more tests while I was in some of the code.
app.go 64.9->65.5%
builder.go 0->75.4%
componentref.go 0->12.4%