Skip to content

Commit

Permalink
[ADD] Pytest schedule (#234)
Browse files Browse the repository at this point in the history
* add schedule for pytests workflow

* Add ref to development branch

* Add scheduled test

* update schedule workflow to run on python 3.8

* omit test, examples, workflow from coverage and remove unnecessary code from schedule

* Fix call for python3.8

* Fix call for python3.8 (2)

* fix code cov call in python 3.8

* Finally fix cov call
  • Loading branch information
ravinkohli committed Jun 10, 2021
1 parent 9e7d3e2 commit 9a847e2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions .coveragerc
@@ -1,6 +1,7 @@
# .coveragerc to control coverage.py
[run]
branch = True
include = "autoPyTorch/*"

[report]
# Regexes for lines to exclude from consideration
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/pytest.yml
Expand Up @@ -32,7 +32,9 @@ jobs:
echo "::set-output name=BEFORE::$(git status --porcelain -b)"
- name: Run tests
run: |
if [ ${{ matrix.code-cov }} ]; then codecov='--cov=autoPyTorch --cov-report=xml --cov-config=.coveragerc'; fi
if [ ${{ matrix.code-cov }} ]; then
codecov='--cov=autoPyTorch --cov-report=xml --cov-config=.coveragerc';
fi
python -m pytest --forked --durations=20 --timeout=600 --timeout-method=signal -v $codecov test
- name: Check for files left behind by test
if: ${{ always() }}
Expand All @@ -50,4 +52,4 @@ jobs:
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true
verbose: true
34 changes: 34 additions & 0 deletions .github/workflows/scheduled_test.yml
@@ -0,0 +1,34 @@
name: Tests

on:
schedule:
# Every Monday at 7AM UTC
- cron: '0 07 * * 1'


jobs:
ubuntu:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
fail-fast: false
max-parallel: 2

steps:
- uses: actions/checkout@v2
with:
ref: development
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip
pip install -e .[test]
- name: Run tests
run: |
python -m pytest --forked --durations=20 --timeout=600 --timeout-method=signal -v test

0 comments on commit 9a847e2

Please sign in to comment.