Skip to content

detect test pollution #7

detect test pollution

detect test pollution #7

name: 'detect test pollution'
# Runs once a month.
# Use pytest with the pytest-random-order plugin to run all tests
# in a random order.
# This aims to detect tests that are not properly isolated
# from each other (test pollution).
on:
# Uses the cron schedule for github actions
#
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events
#
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
schedule:
- cron: "0 0 25 * *" # on the 25th of every monday
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: ./build_tools/github/dependencies.sh
- name: Install nilearn
run: ./build_tools/github/install.sh
- name: Install extra dependencies
run: pip install pytest-random-order
- name: Run tests
run: python -m pytest --pyargs nilearn --cov=nilearn --random-order