Skip to content

Commit

Permalink
Merge pull request #117 from rveachkc/pytest-cov
Browse files Browse the repository at this point in the history
pytest-cov inclusion by @nsano-rururu 

I added this to the circleci config, so coverage is available at https://app.circleci.com/pipelines/github/rveachkc/pymsteams
  • Loading branch information
rveachkc authored Jan 18, 2022
2 parents d311a27 + 9623b33 commit 44a53ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ jobs:
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
mkdir -p /tmp/test-reports/pytest
mkdir -p /tmp/test-reports
mkdir -p /tmp/pytest
mkdir -p /tmp/htmlcov
- run:
name: pytest
command: venv/bin/pytest -v --junitxml=/tmp/test-reports/pytest/results.xml >> /tmp/test-reports/pytest.out
command: venv/bin/pytest -v --cov=pymsteams --cov-report html:/tmp/htmlcov --junitxml=/tmp/pytest/results.xml >> /tmp/test-reports/pytest.out
- run:
name: safety check
command: |
Expand All @@ -66,9 +68,15 @@ jobs:
- store_artifacts:
path: /tmp/test-reports
destination: test-reports
- store_artifacts:
path: /tmp/pytest
destination: pytest
- store_artifacts:
path: /tmp/htmlcov
destination: coverage

- store_test_results:
path: /tmp/test-reports
path: /tmp/pytest


deploy:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ Then, from the root of the repo, install the requirements and run pytest.

```bash
pip install -r dev-requirements.txt
pytest
MS_TEAMS_WEBHOOK=MicrosoftWebhookURL
export MS_TEAMS_WEBHOOK
pytest --cov=./pymsteams --cov-report=term-missing --cov-branch
```

This will send two MS Teams messages describing how they are formatted. Manually validate that the message comes through as expected.
Expand Down
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Pygments>=2.7.4
pylint>=2.5.3
pyparsing>=2.4.0
pytest>=5.0.1
pytest-cov>=3.0.0
PyYAML>=5.4
readme-renderer>=26.0
requests>=2.25.1
Expand Down

0 comments on commit 44a53ff

Please sign in to comment.