{"action":"created","issue":{"url":"https://api.github.com/repos/Shippable/support/issues/3135","repository_url":"https://api.github.com/repos/Shippable/support","labels_url":"https://api.github.com/repos/Shippable/support/issues/3135/labels{/name}","comments_url":"https://api.github.com/repos/Shippable/support/issues/3135/comments","events_url":"https://api.github.com/repos/Shippable/support/issues/3135/events","html_url":"https://github.com/Shippable/support/issues/3135","id":187840169,"number":3135,"title":"Connection refused while component testing my API during CI process","user":{"login":"Neal910","id":7651393,"avatar_url":"https://avatars.githubusercontent.com/u/7651393?v=3","gravatar_id":"","url":"https://api.github.com/users/Neal910","html_url":"https://github.com/Neal910","followers_url":"https://api.github.com/users/Neal910/followers","following_url":"https://api.github.com/users/Neal910/following{/other_user}","gists_url":"https://api.github.com/users/Neal910/gists{/gist_id}","starred_url":"https://api.github.com/users/Neal910/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Neal910/subscriptions","organizations_url":"https://api.github.com/users/Neal910/orgs","repos_url":"https://api.github.com/users/Neal910/repos","events_url":"https://api.github.com/users/Neal910/events{/privacy}","received_events_url":"https://api.github.com/users/Neal910/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-07T21:54:43Z","updated_at":"2016-11-07T23:56:28Z","closed_at":null,"body":"I would like to add component testing into CI process, so I added component testing right after unit test finish. Shippable yml like below:\r\n` # Unit test\r\n- $GRADLE_HOME/bin/gradle build\r\n\r\n   #Component tests\r\n- docker build -f $SHIPPABLE_BUILD_DIR/prod/Dockerfile  -t lrp/forecasting-engine $SHIPPABLE_BUILD_DIR\r\n- docker run -d -p 8080:8080 --name forecasting-engine lrp/forecasting-engine\r\n- $GRADLE_HOME/bin/gradle componentTest`\r\n\r\nIn my component test, I just simply use rest Assured to send a request to API and test response, which works perfectly in my local. Code like below:\r\n`baseURI = \"http://0.0.0.0\";   \r\n port = Integer.getInteger(\"http.port\", 8080);\r\n when().get(\"/forecast\").then().assertThat().statusCode(200).extract().asString();`\r\n\r\nHowever, in Shippable CI process I got java.net.ConnectException: Connection refused. You could take a look my build: [https://app.shippable.com/projects/58101221818c7f0e00199971/status/history].\r\n\r\nI have been using docker ps and inspect to troubleshoot, the container is running and linked to 0.0.0.0:8080, but just componentTest cannot hit on this port. I tried curl as well, got connection refused as well.\r\n\r\nPlease help me out. Thanks a lot.\r\n"},"comment":{"url":"https://api.github.com/repos/Shippable/support/issues/comments/259002594","html_url":"https://github.com/Shippable/support/issues/3135#issuecomment-259002594","issue_url":"https://api.github.com/repos/Shippable/support/issues/3135","id":259002594,"user":{"login":"herriojr","id":259984,"avatar_url":"https://avatars.githubusercontent.com/u/259984?v=3","gravatar_id":"","url":"https://api.github.com/users/herriojr","html_url":"https://github.com/herriojr","followers_url":"https://api.github.com/users/herriojr/followers","following_url":"https://api.github.com/users/herriojr/following{/other_user}","gists_url":"https://api.github.com/users/herriojr/gists{/gist_id}","starred_url":"https://api.github.com/users/herriojr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herriojr/subscriptions","organizations_url":"https://api.github.com/users/herriojr/orgs","repos_url":"https://api.github.com/users/herriojr/repos","events_url":"https://api.github.com/users/herriojr/events{/privacy}","received_events_url":"https://api.github.com/users/herriojr/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T23:56:28Z","updated_at":"2016-11-07T23:56:28Z","body":"I was actually just having this issue and about to post something about it. I'm using docker-compose to bring up local instances of services for component testing as the first step in my ci section, however, when I try and connect to these services during testing, I get a connection refused.  Doing a docker ps shows that these services are in fact running and exposing those particular ports.\r\n\r\nThanks!"}}
{"actor":{"display_login":"herriojr"}}