{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/3732","labels_url":"https://api.github.com/repos/openshift/origin/issues/3732/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/3732/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/3732/events","html_url":"https://github.com/openshift/origin/pull/3732","id":95430637,"number":3732,"title":"Refactoring extended tests","user":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":69,"created_at":"2015-07-16T13:14:54Z","updated_at":"2015-08-05T16:44:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/3732","html_url":"https://github.com/openshift/origin/pull/3732","diff_url":"https://github.com/openshift/origin/pull/3732.diff","patch_url":"https://github.com/openshift/origin/pull/3732.patch"},"body":"This PR contains complete refactor of how you write and execute the extended tests. It also provides a new framework you can use to call the `oc` command from within an extended test.\r\n\r\nTo run the test, you have to have OpenShift server running (with registry and router installed). Then, you can invoke the tests from the `origin` directory:\r\n\r\n```console\r\n$ MASTER_ADDR=https://192.168.124.206:8443 SERVER_CONFIG_DIR=/var/lib/openshift/openshift.local.config GOPATH=\"$(godep path):$GOPATH\" go test -v ./test/extended\r\n```\r\n\r\nThis should produce output like this: https://gist.github.com/mfojtik/65bfe0aa1d23b1441eaa\r\n\r\nThe new `test/extended/util` package provides a framework that allows you to run any `oc` command. \r\n\r\nFor example, following code will process the template and return JSON into `result`:\r\n\r\n```go\r\nresult, err := oc.Run(\"process\").Args(\"-f\", templatePath).Output()\r\n```\r\n\r\nYou can also use Go templates to parse the output. In following example, we get the `dockerImageReference` from the ImageStream:\r\n\r\n```go\r\nimageName, err := oc.Run(\"get\").Args(\"is\", imageStream).Template(\"{{ with index .status.tags 0 }}{{ with index .items 0}}{{ .dockerImageReference }}{{ end }}{{ end }}\").Output()\r\n```\r\n\r\nI think, this will help us write more extended test cases for exotic scenarios and also improves the time of the extended test execution (as you can point it to any OpenShift server as long as you provide admin credentials).\r\n\r\nKudos to @jhadvig for refactoring of `hack/test-extended.sh`\r\n"},"comment":{"url":"https://api.github.com/repos/openshift/origin/issues/comments/128066850","html_url":"https://github.com/openshift/origin/pull/3732#issuecomment-128066850","issue_url":"https://api.github.com/repos/openshift/origin/issues/3732","id":128066850,"user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T16:44:46Z","updated_at":"2015-08-05T16:44:46Z","body":"[merge]"}}