coveragepy / coveragepy/coveragepy

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

Open
#1,827 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
3.4k
Forks
525
Avg merge
18h 27m
Merged PRs (30d)
6

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the linked minimalist flask-app and the provided compose file, comparing docker compose up with docker compose run flask-app. Then trace how coverage data is written during container startup and shutdown. Done means the behavior is explained and a verified change or documented limitation addresses the missing .coverage file.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, python
Domain
devops, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.