New question on test execution

Hi
I have a simple test to skeleton project in spring framework
export default function() {
http.get(‘http://localhost:8080/hello’);
When I execute the test docker-compose run k6 run /tests/02-stages/skeletonProject.js
I see an error message : error=“Get http://localhost:8080/hello: dial tcp 127.0.0.1:8080: connect: connection refused”

Thanks
Vijay

Hi, welcome to the forum!

This is a standard connection error unrelated to k6. Since you’re running inside a Docker container, and if the service you’re testing is exposed on the host network, you’ll need to access it via the Docker bridge interface, run with --net=host, or run the service itself from another container part of the same Compose stack.

See the answers on this SO question for details and other suggestions.

Good luck!

Thanks for the response Imiric.