How to run tests in CI on every pull request
Why it matters
Tests that only run on a laptop protect nothing: the regression reaches the main branch the first time someone forgets. DevOps Check follows Makefile targets, package scripts, shell scripts and GitLab includes to find the test command, not only the workflow file.
How to fix it
What to do: Add a test step to your CI config.
# GitHub Actions — add to .github/workflows/ci.yml:
- name: Run tests
run: pytest --tb=short -q
# GitLab CI — add to .gitlab-ci.yml:
test:
script:
- pytest --tb=short -q
coverage: '/TOTAL.*\s+(\d+%)$/'
Does your repository pass this check?
Free for public GitHub repositories, no account needed. 50+ DevOps and security checks in about ten seconds.