diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000000..c6ce05be34 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +source = glean \ No newline at end of file diff --git a/Makefile b/Makefile index 030904a8df..cee74ebe91 100644 --- a/Makefile +++ b/Makefile @@ -178,7 +178,7 @@ rust-coverage: ## Generate code coverage information for Rust code .PHONY: rust-coverage python-coverage: build-python ## Generate a code coverage report for Python - $(GLEAN_PYENV)/bin/python3 -m coverage run --parallel-mode -m pytest + GLEAN_COVERAGE=1 $(GLEAN_PYENV)/bin/python3 -m coverage run --parallel-mode -m pytest $(GLEAN_PYENV)/bin/python3 -m coverage combine $(GLEAN_PYENV)/bin/python3 -m coverage html .PHONY: python-coverage diff --git a/glean-core/python/glean/_subprocess/_process_dispatcher_helper.py b/glean-core/python/glean/_subprocess/_process_dispatcher_helper.py index e199d9002e..144d537557 100644 --- a/glean-core/python/glean/_subprocess/_process_dispatcher_helper.py +++ b/glean-core/python/glean/_subprocess/_process_dispatcher_helper.py @@ -18,7 +18,7 @@ import sys # Run coverage in the subprocess if necessary - if "COVERAGE_PROCESS_START" in os.environ: + if "GLEAN_COVERAGE" in os.environ and "COVERAGE_PROCESS_START" in os.environ: import coverage # type: ignore config_path = os.environ.get("COVERAGE_PROCESS_START")