coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Unable to get .coverage file in local system when using docker compose up

Open AkashKumar7902 opened this issue 6 months ago • 0 comments

I am unable to get .coverage file in local system when using docker compose up. But .coverage file is getting emitted in case of docker compose run command but not in up

I am mounting my current working directory in docker container, and also changing the current working directory in container to the current dir in local.

the below is my docker-compose file:

services:
  flask-app:
    image: flask-app:1.0
    container_name: flask-app
    build:
      context: .
    ports:
      - "6000:6000"
    volumes:
      - ${PWD}:${PWD}
    working_dir: ${PWD}

https://github.com/AkashKumar7902/flask-app the above is a minimalist reproducible app.

First run docker compose up and stop the app, you won't find any .coverage file. After that, run docker compose run flask-app, the difference can be seen.

AkashKumar7902 avatar Jul 30 '24 08:07 AkashKumar7902