I am testing my API during my build process. From the logs I can see the API starts correctly but all http requests sent by my unit test fail with the error message:
ConnectionRefusedError: [Errno 111] Connection refused
Here is the configuration I have in config.yml
for these two steps;
- run:
name: Start API
command: |
. gql/bin/activate
cd example
python3 api.py
background: true
- run:
name: Run Tests
command: |
. gql/bin/activate
nose2 --plugin nose2.plugins.junitxml --junit-xml -v
When I start the API locally on my machine and run the tests, everything runs fine. From this point I’m a little bit stuck and don’t know how to investigate:
- Is the issue coming from the API which is actually not running in background?
- Is the issue coming from the http requests?
Here is an example of build failing: https://circleci.com/gh/alexisrolland/flask-graphene-sqlalchemy/14