Skip to content

refactored test/cmd/builds to use wrapper methods - #6034

Merged
openshift-bot merged 1 commit into
openshift:masterfrom
stevekuznetsov:skuznets/refactor-test-cmd-builds
Nov 25, 2015
Merged

openshift-bot merged 1 commit into
openshift:masterfrom
stevekuznetsov:skuznets/refactor-test-cmd-builds

Conversation

@stevekuznetsov

Copy link
Copy Markdown
Contributor

/cc @deads2k

@bparees @csrwng PTAL -- please review and ensure that the expectations (success, failure, with/without text) are correct to what you expected from the tests previously.

Also, I think we need better tests in this bucket, but I'm not sure - many just require success, and have no output tests, so they aren't really testing that the build that was supposed to have started actually did, etc. What do you all think?

Comment thread test/cmd/builds.sh Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't really understand why this is failing, but this is the error output I get:

FAILURE: oc start-build --from-webhook=https://127.0.0.1:28443/oapi/v1/namespaces/cmd-builds/buildconfigs/ruby-sample-build/webhooks/secret101/generic: the command returned the wrong error code
error: server rejected our request 500
remote: {
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "Internal error occurred: could not generate a build: imageStreamTag \"ruby-20-centos7:latest\" not found",
  "reason": "InternalError",
  "details": {
    "causes": [
      {
        "message": "could not generate a build: imageStreamTag \"ruby-20-centos7:latest\" not found"
      }
    ]
  },
  "code": 500
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

However, just above this, the start-build for the ruby-sample-build works and uses the same image stream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does it only fail after the refactor?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

start-build --list-webhooks doesn't start a build. (not even sure why that's a valid command)

so this is the first command that's actually starting a build using that imagestream, i think.

still not clear why your refactor breaks it though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bparees It was added by @smarterclayton so we could get a webhook using the CLI (for script processing)

i'm not surprised, it's still a very awkward construction.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is a better way of waiting on imagesteams using tryuntil. I'll implement that and see if this fixes it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That fixed it.

@stevekuznetsov stevekuznetsov changed the title refactored test/cmd/builds to use wrapper methods [wip] refactored test/cmd/builds to use wrapper methods Nov 24, 2015
@liggitt

liggitt commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

they aren't really testing that the build that was supposed to have started actually did,

test-cmd.sh runs without a node… how were you envisioning a build would start?

@liggitt

liggitt commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

Or do you mean checking a build API object was created?

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Yes, the objects - that's what some of the other scripts are doing.

@bparees

bparees commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

I like the refactor since it appears we'll get useful success/fail messages for each command instead of the current unreadable mess when the script abruptly terminates on a non-zero return code.

as for whether these commands all expect success, yes all of these can be assumed to expect success.

checking that a build object was actually created is probably overkill, we have other testing for that. Here i think it's safe to assume that if something went wrong, the CLI would return a non-zero error code.

Comment thread test/cmd/builds.sh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here I found --text again, and again I removed it. I'm not really sure what it is doing here.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@bparees Changes other than simple substitutions of the os::cmd functions I just added comments to, so that your review was easier. Let me know if you see anything you don't like.

@stevekuznetsov
stevekuznetsov force-pushed the skuznets/refactor-test-cmd-builds branch from b5c2007 to c4a2f16 Compare November 24, 2015 14:39
@stevekuznetsov stevekuznetsov changed the title [wip] refactored test/cmd/builds to use wrapper methods refactored test/cmd/builds to use wrapper methods Nov 24, 2015
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

[test] this is ready

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to c4a2f16

@deads2k

deads2k commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

@csrwng you mind taking this one?

@csrwng

csrwng commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

yup, I can take it

@csrwng

csrwng commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

LGTM, pending test output

@csrwng

csrwng commented Nov 24, 2015

Copy link
Copy Markdown
Contributor

[merge]

@openshift-bot

Copy link
Copy Markdown
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/4144/) (Image: devenv-rhel7_2799)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin merge up to c4a2f16

@openshift-bot

Copy link
Copy Markdown
Contributor

openshift-bot pushed a commit that referenced this pull request Nov 25, 2015
@openshift-bot
openshift-bot merged commit 6cc2e87 into openshift:master Nov 25, 2015
@stevekuznetsov
stevekuznetsov deleted the skuznets/refactor-test-cmd-builds branch January 8, 2016 15:23
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.

6 participants