Skip to content

Commit 2940f64

Browse files
authored
Merge pull request #352 from RamonAra209/main
Adding coverage to tests
2 parents 3154be3 + 4f04e1e commit 2940f64

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Codecov Action
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
name: Test python API
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Install requirements
12+
run: |
13+
pip install -r requirements-tests.txt
14+
pip install -r requirements-dev.txt
15+
- name: Run tests and collect coverage
16+
run: make coverage-tests
17+
- name: Upload coverage reports to Codecov
18+
run: |
19+
# Replace `linux` below with the appropriate OS
20+
# Options are `alpine`, `linux`, `macos`, `windows`
21+
curl -Os https://uploader.codecov.io/latest/linux/codecov
22+
chmod +x codecov
23+
./codecov -t ${CODECOV_TOKEN}

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ tests:
1414
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \
1515
${PYTHON} -m pytest -v $(TESTARGS)
1616

17+
.PHONY: coverage-tests
18+
coverage-tests:
19+
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \
20+
${PYTHON} -m pytest -v --cov $(TESTARGS)
21+
1722
.PHONY: verbose-tests
1823
verbose-tests:
1924
PYTHONPATH=$(CWD)/src:$(CWD)/tests/plugins1:$(CWD)/tests/plugins2:${PYTHONPATH} \

requirements-tests.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
pytest >= 6.2.0
77
requests >= 2.25.1
8+
pytest-cov

0 commit comments

Comments
 (0)