Skip to content

Commit c7de72c

Browse files
authored
Enable test coverage check (#126)
In this PR we are enabling test coverage checks, which will ensure that we maintain a high bar of test coverage. Also in this PR, we are removing the "benchmarking" option, as we do not currently have any benchmarks enabled: https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/8423785726/job/23066213144#step:4:627 Current test coverage: 1427 statements, 95 missed, 93.34% coverage Regarding `{envsitepackagesdir}`, please see https://stackoverflow.com/questions/58696476/tox-0-coverage Testing: * First raised the PR with 99% test coverage and workflows failed: [link](https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/8456289567/job/23165730029?pr=126) * Then raised with 93% test coverage and workflows passed (see below) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent de37303 commit c7de72c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[report]
2+
include_namespace_packages = true
3+
fail_under = 93.00
4+
precision = 2

.github/actions/set_up/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ runs:
4141
- name: Run unit tests/benchmarks with tox
4242
if: ${{ inputs.run_unit_tests == 'true' }}
4343
shell: bash
44-
run: tox -f ${{ inputs.python_version }}-${{ inputs.package_name }} -- -ra --benchmark-json=${{ inputs.python_version }}-${{ inputs.package_name }}-${{ inputs.os }}-benchmark.json
44+
run: tox -f ${{ inputs.python_version }}-${{ inputs.package_name }} -- -ra

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ envlist =
1414
deps =
1515
-c dev-requirements.txt
1616
test: pytest
17-
test: pytest-benchmark
17+
test: pytest-cov
1818

1919
setenv =
2020
; TODO: The two repos branches need manual updated over time, need to figure out a more sustainable solution.
@@ -37,7 +37,7 @@ commands_pre =
3737
aws-opentelemetry-distro: pip install {toxinidir}/aws-opentelemetry-distro
3838

3939
commands =
40-
test: pytest {posargs}
40+
test: pytest --cov={envsitepackagesdir}/amazon --cov-config=../../.coveragerc {posargs}
4141

4242
[testenv:spellcheck]
4343
basepython: python3

0 commit comments

Comments
 (0)