Repository navigation
Allow setting the build output image reference in oc new-build - #5141
Conversation
|
This alone does not make it possible to have no output for a build. @smarterclayton do you think we should have another argument like |
7aceab7 to
2c52969
Compare
|
There was an unreported bug with |
|
[test] |
7ab3c2c to
5717fd0
Compare
|
@smarterclayton PTAL |
There was a problem hiding this comment.
We always use len(to) > 0 or len(to) == 0 for this.
5717fd0 to
bc4e731
Compare
|
@smarterclayton thanks for the review, I've updated code accordingly. I don't know how to use 'oc new-app' / 'new-build' to create more than 1 build at once, except for doing 'oc new-app template.json'. Is there another way that I'm missing? |
|
Ok, I figured what I'm missing, working on it. |
bc4e731 to
8f4d783
Compare
|
Comments addressed, added similar checks for --to as there are for --name. |
|
oc new-app openshift/php~ openshift/ruby~ On Mon, Oct 19, 2015 at 9:20 AM, Rodolfo Carvalho [email protected]
|
Yes, I got that. Added similar checks as for |
8f4d783 to
c729c84
Compare
|
Rebased on top of newest kube godep, apparently this PR was not affected by the changes in kube. |
c729c84 to
a496922
Compare
|
@smarterclayton, based on your comments, my most recent push:
PTAL |
|
Looks good, you have some failing unit tests in jenkins. |
a496922 to
4ccd940
Compare
|
@bparees @smarterclayton I've updated test/cmd/builds.sh fixing the merge conflict with #6034, and updating the test code to use the wrapper methods. |
5000706 to
be9ee80
Compare
There was a problem hiding this comment.
@smarterclayton @bparees also included this test to check "--to" given two source repos (invalid usage).
|
Could anybody re-merge this, please? |
There was a problem hiding this comment.
Hmm, any way to use the test functions directly? Would like to avoid complex per-use bash functions. @stevekuznetsov any suggestions?
There was a problem hiding this comment.
The smart functions from the util are still used -- lines 26-28. This is to avoid repeating the same pattern over and over.
There was a problem hiding this comment.
If it fails, what line gets logged? Can we tell which call into the shared function caused it?
There was a problem hiding this comment.
The output will look like three tests are run, I think this should be pretty straight forward. However, no, the line file/line spec will show this function add the source, not the original calls.
There was a problem hiding this comment.
I think an os::cmd::expect_success on the new-build, a function to build the correct template, and a os::cmd::expect_success_and_text on the get with the template should suffice - I'm not sure making the tests less explicit is worth it.
There was a problem hiding this comment.
Very soon (next week?) I will be tweaking the output of the functions to read (Running|SUCCESS|FAILURE): file:line_number: wrapper args, where file:line_number: will be the place where the wrapper is called. For this case, the failure text will bring you to the call inside the function when instead you want the call of os::cmd::builds::expect_build_output_spec. You could still see that from the stack trace, but I'm not sure if it's worth the confusion - especially since jUnit integration will use that line number and file to track flakes, we won't get useful data for flakes using this function.
There was a problem hiding this comment.
Also, small nit - this function should live in hack/builds.sh once #5844 is sorted out, and maybe in hack/cmd_util.sh or hack/util.sh for now, not here.
There was a problem hiding this comment.
template='{{with .spec.output.to}}{{.kind}} {{.name}}{{end}}'
os::cmd::expect_success 'oc new-build <args>'
os::cmd::expect_success_and_text "oc get bc/<name> --template '${template}'" '<text>'This is fairly concise, clear, and doesn't have drawbacks for jUnit. I think it's OK if our tests are verbose, literal, and the less bash trickery we use the better.
There was a problem hiding this comment.
Just curiosity, why are we creating a bash test framework?
There was a problem hiding this comment.
Testing cli invocations is (somewhat) reasonably done via bash. We already had a bash framework, we're just trying to make it (more) reasonable to jump in and know exactly what is supposed to be getting checked.
be9ee80 to
36be74f
Compare
|
Fixed mixing spaces and tabs in |
There was a problem hiding this comment.
This line looks like something this function shouldn't be doing - I wouldn't expect this side effect from the name.
There was a problem hiding this comment.
I dunno, I would rather see repeated commands than have to manage another level of indirection. Do we actually need to do the delete all every time if we use different names?
There was a problem hiding this comment.
I would rather see repeated commands
I agree. Let test files be verbose.
36be74f to
c098b5e
Compare
|
@stevekuznetsov @liggitt I've flattened out the tests PTAL |
c098b5e to
eabc3d0
Compare
There was a problem hiding this comment.
If the oc delete lines are cleanup from the previous test, I'd stick them there instead of them leading the next test. Otherwise these LGTM as far as formatting and readability, can't comment on correctness.
|
[test] |
eabc3d0 to
57747fd
Compare
|
Evaluated for origin test up to 57747fd |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/7495/) |
|
lgtm [merge] |
|
Evaluated for origin merge up to 57747fd |
Merged by openshift-bot
This makes it possible to do:
The above will define a build output image and works in concert with
--to-docker(and--name, too).Fixes #4980.