CircleCI - how to connect to localhost

In CircleCI, I run an application that I would like to run tests:

test: pre: # run app - ./gradlew bootRun -Dgrails.env=dev: background: true - sleep 40 override: - ./gradlew test 

In the local application, the application is available at http://localhost:8080 . I see that the application is starting in CircleCI.

I thought I would change the localhost host:

 machine: # Override /etc/hosts hosts: localhost: 127.0.0.1 

My tests work locally correctly. In CircleCI they always end without a connection when calling new HttpPost("http://localhost:8080/api"); with this error:

org.apache.http.conn.HttpHostConnectException on SendMessageSpec.groovy: 44 Called: java.net.ConnectException on SendMessageSpec.groovy: 44

+5
source share
1 answer

I had to increase my sleep time to something unreasonably large. - sleep 480

I think I'll see how to block the tests until the application runs.

0
source

Source: https://habr.com/ru/post/1257743/


All Articles