Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d03bdf7
ci: convert autotests to use pytest
jdhughes-dev Oct 24, 2021
bd15fd9
ci: convert autotests to use pytest
jdhughes-dev Oct 24, 2021
2b34082
ci: convert autotests to use pytest
jdhughes-dev Oct 24, 2021
80806ed
ci: convert autotests to use pytest
jdhughes-dev Oct 24, 2021
d52e5ed
ci: convert autotests to use pytest
jdhughes-dev Oct 24, 2021
6b4680c
ci: convert autotests to use pytest
jdhughes-dev Oct 24, 2021
af8eba0
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
687b901
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
ab54656
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
ff66d6f
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
399e690
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
b194d1e
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
4a8745d
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
f2f9069
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
4f54b68
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
073f0a9
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
6ee437e
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
95839fe
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
9257bc0
ci: convert autotests to use pytest
jdhughes-dev Oct 25, 2021
dcaeb9e
ci: convert autotests to use pytest
jdhughes-dev Oct 26, 2021
b3afe70
ci: convert autotests to use pytest
jdhughes-dev Oct 26, 2021
e456b45
ci: convert autotests to use pytest
jdhughes-dev Oct 26, 2021
ee752dc
ci: convert autotests to use pytest
jdhughes-dev Oct 27, 2021
192165c
ci: convert autotests to use pytest
jdhughes-dev Oct 27, 2021
3ff5fce
ci: convert autotests to use pytest
jdhughes-dev Oct 28, 2021
520f387
ci: convert autotests to use pytest
jdhughes-dev Oct 28, 2021
af9c0ba
ci: convert autotests to use pytest
jdhughes-dev Oct 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci-mf6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- master
- develop
- 'release*'
- 'ci-pytest'
pull_request:
branches: [master, develop]

Expand Down Expand Up @@ -99,6 +100,11 @@ jobs:
run: |
pytest -v -n auto -k "test_gw" --durations=0 --cov=flopy --cov-report=xml

- name: Print coverage report before upload
working-directory: ./modflow6/autotest
run: |
coverage report

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2.1.0
with:
Expand Down
45 changes: 32 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- master
- develop
- 'release*'
- 'ci-pytest'
pull_request:
branches: [master, develop]

Expand All @@ -22,7 +23,6 @@ jobs:
run:
shell: bash

if: github.repository_owner == 'modflowpy'
steps:

# check out repo
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
run:
shell: bash

if: github.repository_owner == 'modflowpy' && github.event_name != 'schedule'
if: github.event_name != 'schedule'
steps:
# check out repo
- name: Checkout flopy repo
Expand Down Expand Up @@ -109,11 +109,11 @@ jobs:
- os: ubuntu-latest
python-version: 3.9
run-type: nb
test-path: autotest_notebooks.py
test-path: run_notebooks.py
- os: ubuntu-latest
python-version: 3.9
run-type: script
test-path: autotest_scripts.py
test-path: run_scripts.py
defaults:
run:
shell: bash -l {0}
Expand Down Expand Up @@ -166,23 +166,42 @@ jobs:
pip install xmipy
pip install . --use-feature=in-tree-build

- name: Download executables needed for tests
- name: Prepare for the autotests
working-directory: ./autotest
run: |
cd autotest
python get_exes.py
cd ..
pytest -v ci_prepare.py

- name: Add executables directory to path
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Run nosetests
- name: Run pytest on autotest scripts on Linux and MacOS
if: matrix.run-type == 'std' && runner.os != 'Windows'
working-directory: ./autotest
run: |
coverage run -m nose -v --with-id --with-timer \
--with-coverage --cover-package=flopy --cover-xml \
--cover-xml-file=../coverage.xml -w ./autotest ${{ matrix.test-path }}
pytest -v -n auto --durations=0 --cov=flopy --cov-report=xml

- name: Run pytest on autotest scripts on Windows
if: matrix.run-type == 'std' && runner.os == 'Windows'
working-directory: ./autotest
run: |
pytest -v -n auto --durations=0 --cov=flopy --cov-report=xml

- name: Run pytest on scripts and notebooks
if: matrix.run-type != 'std'
working-directory: ./autotest
run: |
pytest -v -n auto --durations=0 --cov=flopy --cov-report=xml ${{ matrix.test-path }}

- name: Print coverage report before upload
working-directory: ./autotest
run: |
coverage report

- name: Upload coverage to Codecov
if:
github.repository_owner == 'modflowpy' && github.event_name == 'push'
uses: codecov/codecov-action@v2.1.0
with:
file: ./coverage.xml
directory: ./autotest
file: coverage.xml
10 changes: 5 additions & 5 deletions .github/workflows/rtd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
- develop
- 'release*'
- 'ci-pytest'
pull_request:
branches: [master, develop]

Expand All @@ -20,7 +21,6 @@ jobs:
run:
shell: bash -l {0}

if: github.repository_owner == 'modflowpy'
steps:
- name: Checkout flopy repo
uses: actions/checkout@v2.3.4
Expand Down Expand Up @@ -57,19 +57,19 @@ jobs:
pip install xmipy
pip install .

- name: Download executables needed for tests
- name: Prepare for the autotests
working-directory: ./autotest
run: |
python ./autotest/get_exes.py
pytest -v ci_prepare.py

- name: Add executables directory to path
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Run jupytext on tutorials
working-directory: ./.docs
run: |
cd .docs/
python create_tutorials.py
cd ../

- name: Upload completed jupyter notebooks as an artifact for ReadtheDocs
if:
Expand Down
53 changes: 0 additions & 53 deletions autotest/autotest_notebooks.py

This file was deleted.

132 changes: 0 additions & 132 deletions autotest/autotest_scripts.py

This file was deleted.

33 changes: 33 additions & 0 deletions autotest/ci_cleanup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Remove the temp directory if it exists
import os
import shutil

from ci_framework import get_parent_path


def cleanup_autotests():
parent_path = get_parent_path()
if parent_path is None:
print("can not clean autotests")
else:
tempdir = os.path.join(parent_path, "temp")
if os.path.isdir(tempdir):
shutil.rmtree(tempdir)
return


def cleanup_stray_files():
trashExtensions = (".chk", ".dat")
parent_path = get_parent_path()

files = [f for f in os.listdir(parent_path)]
for file in files:
if os.path.isfile(file):
extension = os.path.splitext(file)[1]
if extension in trashExtensions:
os.remove(file)


if __name__ == "__main__":
cleanup_autotests()
cleanup_stray_files()
Loading