Skip to content

Commit

Permalink
Fix toolkit tests (#227)
Browse files Browse the repository at this point in the history
* Ensure 0.11.0 RC version of toolkit is installed

* Possible fix to finish #191

* Try to ensure bash args thing is passed through

* Naive unit refactor

* Work through tests

* Update CI matrix

* Use mamba for development

* Debug, add boilerplate .gitignore

* Fix syntax

* make sure the package didn't get installed before we install it

* Do not install Espaloma

* Fix some unit registries in tests

* install espaloma, but remove openmmforcefields

* add back in espaloma

* switch to micromamba

* Explicitly move ffxml sources into entry point

* Remove symlinking

* Add boilerplate `.gitignore`

* Update package installation in CI

* Fix finding Amber files in test

* Soft import whatever units module is used by the toolkit

* Switch to micromamba for setting up conda environment

Add boilerplate `.gitignore` file

Do not pull from non-standard labels

Install instead of update

Try to figure out why if: {{ false }} still triggers

Syntax?

Tinker

Bring in (full) mamba

Bash thing everywhere

Bring down old toolkit

Do not present un-loadable ff14SB port as available

More pins

* Fix YAML syntax

* Use pip

* More fixes

* No particles
* Fix unit serialization
* Fix Atom.element calls

* Update some tests

* Clean up un-used imports

* Fix more tests

* Fix more tests

* Exclude Python 3.10 on macOS

* Skip ff14SB being treated as a small molecule

* Fix test

* Track duration of longest 20 tests

* Update action versions

* Try to fix exclusions in CI matrix

* Fix pathing in Amber conversion

* Run `pyupgrade --py38-plus`

* Try directly uploading coverage report

* Fix syntax

* Add back some tests

* Debug

* Drop `pytest-xdist` arg

* Fiddle with path

* Just try to get stuff passing

* Try uploading again

* Switch back to codecov

* Simply coverage reporting

* Allow 0 coverage

* Simplify coverage arguments

* Add `__init__.py` in `/tests/` submodule

https://stackoverflow.com/a/60579142

* Add `__init__.py` in `/tests/` submodule

https://stackoverflow.com/a/60579142

* Simplify coverage arguments

* Add back durations argument

* Apply suggestions from code review

* only upload report if it is not scheduled

Co-authored-by: Matthew W. Thompson <mattwthompson@protonmail.com>
  • Loading branch information
mikemhenry and mattwthompson committed Sep 15, 2022
1 parent e7f2fe3 commit 35496e5
Show file tree
Hide file tree
Showing 103 changed files with 47,811 additions and 47,311 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]
latest-openff-toolkit: [true, false]
exclude:
- python-version: "3.10"
os: macos-latest

steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v3

- name: Setup Conda Environment
uses: mamba-org/provision-with-micromamba@main
Expand All @@ -52,25 +55,29 @@ jobs:
- name: "Install latest openff-toolkit"
if: ${{ matrix.latest-openff-toolkit == true }}
run: |
# Until #225 is complete, we should not assume compatibility with new API
micromamba install "openff-toolkit =0.10.6" -c conda-forge -y
micromamba update -y -c conda-forge "openff-toolkit >=0.11.0"
- name: Install Package
run: |
# Can't use 'develop' mode because we remove symlinks after install is complete
python setup.py install
pip list
micromamba list
micromamba remove --force openmmforcefields
python -m pip install .
- name: Conda Environment Information
run: |
conda info
conda list
micromamba info
micromamba list
python -c "from openmmforcefields import __version__, __file__; print(__version__, __file__)"
- name: Test Installed Package
run: |
pytest -v -x -s --log-cli-level $LOGLEVEL --cov=openmmforcefields openmmforcefields/tests/test_amber_import.py
pytest -v -x -s --log-cli-level $LOGLEVEL --cov=openmmforcefields openmmforcefields/tests/test_template_generators.py
pytest -v -x -s --log-cli-level $LOGLEVEL --cov=openmmforcefields openmmforcefields/tests/test_system_generator.py
pytest -v -x --log-cli-level $LOGLEVEL $COV_ARGS --durations=20 \
openmmforcefields/tests/test_amber_import.py \
openmmforcefields/tests/test_template_generators.py \
openmmforcefields/tests/test_system_generator.py
env:
COV_ARGS: --cov=openmmforcefields --cov-config=setup.cfg --cov-append --cov-report=xml
LOGLEVEL: "INFO"
KMP_DUPLICATE_LIB_OK: "True"

Expand All @@ -93,11 +100,11 @@ jobs:
working-directory: ./charmm

- name: CodeCov
- name: Upload coverage report to CodeCov
uses: codecov/codecov-action@v3.1.0
if: ${{ github.repository == 'openmm/openmmforcefields'
&& github.event != 'schedule' }}
uses: codecov/codecov-action@v3.1.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
fail_ci_if_error: true
20 changes: 15 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ coverage.xml

# Django stuff:
*.log
local_settings.py

# Sphinx documentation
docs/_build/
docs/api/generated

# Flask stuff:
instance/
Expand All @@ -62,12 +65,13 @@ instance/
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# PyCharm
*.idea/vcs.xml

# Jupyter
# Jupyter Notebook
.ipynb_checkpoints

Expand Down Expand Up @@ -108,5 +112,11 @@ ENV/
# In-tree generated files
*/_version.py

# OS X extra files
# macOS
*.DS_Store

# Caches
openmmforcefields/data/perses_jacs_systems/*/cache.json

# Test molecules
testsystem-bace*
Loading

0 comments on commit 35496e5

Please sign in to comment.