Skip to content
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

Merged
merged 1 commit into from
May 16, 2017

Conversation

pweil-
Copy link
Contributor

@pweil- pweil- commented Apr 25, 2017

@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%

@pweil-
Copy link
Contributor Author

pweil- commented Apr 25, 2017

[test]

Copy link
Contributor

@soltysh soltysh left a 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!

@@ -14,6 +14,7 @@ import (
imageapi "github.com/openshift/origin/pkg/image/api"

_ "github.com/openshift/origin/pkg/api/install"
"strings"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know me 🚔

val string
expectedReturn bool
}{
{"foo", false},
Copy link
Contributor

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},
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

"testing"

imageapi "github.com/openshift/origin/pkg/image/api"
"reflect"
Copy link
Contributor

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")
Copy link
Contributor

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?

},
expectedReturn: true,
},
"has legacy envrionment STI_LOCATION": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

environment

},
expectedReturn: true,
},
"has legacy envrionment STI_BUILDER": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

environment

},
expectedReturn: true,
},
"has legacy envrionment STI_SCRIPTS_URL": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

environment

@pweil- pweil- force-pushed the generate-app-tests branch from 8cb79d1 to 1c8795c Compare May 2, 2017 13:06
@pweil-
Copy link
Contributor Author

pweil- commented May 2, 2017

[test]

@soltysh
Copy link
Contributor

soltysh commented May 2, 2017

LGTM

@pweil-
Copy link
Contributor Author

pweil- commented May 2, 2017

#13942

[test]

@pweil-
Copy link
Contributor Author

pweil- commented May 2, 2017

re[test]

1 similar comment
@pweil-
Copy link
Contributor Author

pweil- commented May 8, 2017

re[test]

@pweil-
Copy link
Contributor Author

pweil- commented May 16, 2017

[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 1c8795c

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1483/) (Base Commit: b96ef9a)

@pweil-
Copy link
Contributor Author

pweil- commented May 16, 2017

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented May 16, 2017

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)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 1c8795c

@openshift-bot openshift-bot merged commit a6f21d9 into openshift:master May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase unit test for pkg/generate/app
5 participants