Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pytest-dev/pytest-github-actions-annotate-failures
Pytest plugin to annotate failed tests with a workflow command for GitHub Actions
https://github.com/pytest-dev/pytest-github-actions-annotate-failures
github-actions pytest python testing workflow
Last synced: 29 days ago
JSON representation
Pytest plugin to annotate failed tests with a workflow command for GitHub Actions
- Host: GitHub
- URL: https://github.com/pytest-dev/pytest-github-actions-annotate-failures
- Owner: pytest-dev
- License: mit
- Created: 2020-05-08T15:16:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T07:35:11.000Z (6 months ago)
- Last Synced: 2024-05-15T21:21:09.267Z (6 months ago)
- Topics: github-actions, pytest, python, testing, workflow
- Language: Python
- Homepage: https://pypi.org/project/pytest-github-actions-annotate-failures/
- Size: 111 KB
- Stars: 117
- Watchers: 5
- Forks: 9
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# pytest-github-actions-annotate-failures
[Pytest](https://pypi.org/project/pytest/) plugin to annotate failed tests with a [workflow command for GitHub Actions](https://help.github.com/en/actions/reference/workflow-commands-for-github-actions)## Usage
Just install and run pytest with this plugin in your workflow. For example,```yaml
name: teston:
push:jobs:
test:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v3- uses: actions/setup-python@v4
with:
python-version: 3.7- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt- name: Install plugin
run: pip install pytest-github-actions-annotate-failures- run: pytest
```If your test is running in a Docker container, you have to install this plugin and manually set `GITHUB_ACTIONS` environment variable to `true` inside of Docker container. (For example, `docker-compose run --rm -e GITHUB_ACTIONS=true app -- pytest`)
If your tests are run from a subdirectory of the git repository, you have to set the `PYTEST_RUN_PATH` environment variable to the path of that directory relative to the repository root in order for GitHub to identify the files with errors correctly.
## Screenshot
[![Image from Gyazo](https://i.gyazo.com/b578304465dd1b755ceb0e04692a57d9.png)](https://gyazo.com/b578304465dd1b755ceb0e04692a57d9)