In CircleCI
I run an app that I would like to run the tests against:
test:
pre:
# run app
- ./gradlew bootRun -Dgrails.env=dev:
background: true
- sleep 40
override:
- ./gradlew test
On localhost the app is accessible on http://localhost:8080
. I can see the app startup on CircleCI
.
I thought that I would change the host localhost
:
machine:
# Override /etc/hosts
hosts:
localhost: 127.0.0.1
My tests work locally correctly. On CircleCI
they always end up without connection when calling new HttpPost("http://localhost:8080/api");
with this error:
org.apache.http.conn.HttpHostConnectException at SendMessageSpec.groovy:44
Caused by: java.net.ConnectException at SendMessageSpec.groovy:44
I’ve also asked a question on StackOverflow.