Skip to content

CICD-085 · Report flaky test reruns explicitly ​

Encyclopedia · Tests and quality checks · All snippets

Previous · CICD-084 · Next · CICD-086

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites repository with test fixtures and task-specific quality dependencies.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
pytest -q --reruns 1 --junitxml=rerun.xml

3. How it works ​

Pytest discovers the selected test files or markers and returns a process exit status reflecting the test outcome.

4. Verify the result ​

Install pytest-rerunfailures and keep retries visible. Treat persistent flaky results as a tracked defect.

Validation syntax-validated (Bash parse). Status definitions.