apache / apache/airflow

Add proper coverage for K8S tests

Open
#16,793 3 comments 0 reactions 0 assignees View on GitHub
good first issue kind:task provider:cncf-kubernetes
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 10h
Merged PRs (30d)
483

Description

Currently K8S tests are not testing Airflow source coverage because actual airflow code runs inside Docker container in K8S (pytest is added in the virtualenv in host, so the only thing coverage can capture is the coverage of "test" files which makes no sense.

We should remove the coverage from host and add coverage capturing inside the docker container.

This is a bit involved, because it needs to:

1) add coverage libraries to the kubernetes docker image
2) enable capturing coverage via environment variable
3) find a way to dump the coverage files from running containers (all of them - webserver, scheduler, worker) and export them from K8S.

So for now we should just disable the nonsense coverage gathering especially that it causes random failures in case of parallel run of K8S tests.

**Apache Airflow version**:

**Kubernetes version (if you are using kubernetes)** (use `kubectl version`):

**Environment**:

- **Cloud provider or hardware configuration**:
- **OS** (e.g. from /etc/os-release):
- **Kernel** (e.g. `uname -a`):
- **Install tools**:
- **Others**:

**What happened**:

**What you expected to happen**:

**How to reproduce it**:

**Anything else we need to know**:

Contributor guide

Open the contributing guide

Research direction

Start by locating the Kubernetes test configuration and the host-side coverage setup referenced by the issue. Check how the Kubernetes Docker image, environment variables, and running webserver, scheduler, and worker containers are involved. Done means host coverage no longer captures only test files or causes parallel-run failures, with container coverage left as the stated follow-up.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes, python
Domain
devops, infrastructure, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.