Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest #2504

Closed
Closed

pytest #2504

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9c5e299
remove deprecated rule from makefile phony list
JacksonBurns Jul 22, 2023
c24d894
move testing files to test dir
JacksonBurns Jul 22, 2023
74cb1b8
delete unused arkane tests, move database test
JacksonBurns Jul 22, 2023
db83695
move and rename files not following the naming convention
JacksonBurns Jul 22, 2023
f3c5d13
fix conflicting test file names
JacksonBurns Jul 22, 2023
1653cb2
black formatting for all test files
JacksonBurns Jul 22, 2023
2c9555c
delete unnecessary name main statements
JacksonBurns Jul 22, 2023
c396d82
manually switch testdatabase to assert from yield generator
JacksonBurns Jul 22, 2023
878090f
yet more name conflicts and pytest warnings
JacksonBurns Jul 22, 2023
2fdd422
remove nosetest asserts with nose2pytest
JacksonBurns Jul 22, 2023
e62408b
remove support for Q2Dtor
JacksonBurns Jul 22, 2023
8e81bf2
remove external software folder - no longer relevant bc of conda
JacksonBurns Jul 22, 2023
830f24f
use bare assert statements (pytest style)
JacksonBurns Jul 22, 2023
9bcd0c8
delete unmaintained requirements file
JacksonBurns Jul 22, 2023
ae88a20
update makefile, run all tests at once to avoid double aggregation time
JacksonBurns Jul 22, 2023
14c78f5
multiple co-dependent changes, see extended description
JacksonBurns Jul 22, 2023
203f0a1
tests running, but not passing
JacksonBurns Jul 22, 2023
8d3aef9
fix skippable tests
JacksonBurns Jul 22, 2023
519c3f1
update the default filepath for `test_data` to its new location
JacksonBurns Jul 22, 2023
17c855f
rename setup_class and teardown_class
JacksonBurns Jul 22, 2023
1befee0
run tests in parallel, remove unnecessary run files
JacksonBurns Jul 22, 2023
cd74946
yet more setUp -> setup_class etc.
JacksonBurns Jul 22, 2023
4aec35c
parallel test execution does not work with Julia and pytest
JacksonBurns Jul 22, 2023
cf08dfa
fix use of np.float and np.bool
JacksonBurns Jul 22, 2023
75053bb
consolidate test_data directories
JacksonBurns Jul 22, 2023
f25b149
fix np.int warning, remove hinderedrotor2d example
JacksonBurns Jul 22, 2023
4cbe24b
fix a couple more unit tests
JacksonBurns Jul 22, 2023
5d31b3a
more hacks for pytest compat, remove deprecated methods
JacksonBurns Jul 23, 2023
22b3738
all tests running, fix numpy types compilation issue
JacksonBurns Jul 23, 2023
3d0279c
remove unittest self.fail syntax, fix more tests, remove more dep meths
JacksonBurns Jul 23, 2023
5c9d2aa
multiple, see ext
JacksonBurns Jul 23, 2023
0ff1468
fix pytest-check install issue
JacksonBurns Jul 23, 2023
824b68f
typo
JacksonBurns Jul 23, 2023
4f62237
fix failed julia import warning
JacksonBurns Jul 23, 2023
8eb7874
fix gitignore for example dir
JacksonBurns Jul 23, 2023
3f98f4e
increased test verbosity for debuggin
JacksonBurns Jul 24, 2023
47fe352
remove deprecated methods from docs
JacksonBurns Jul 24, 2023
106acf2
remove gas phase warning - so much output it crashes runner
JacksonBurns Jul 24, 2023
85b5fe1
remove example output from `.gitignore`
JacksonBurns Jul 24, 2023
92df0cd
resolve #2489
JacksonBurns Jul 24, 2023
c52742b
more test patches, arkane test was basically killing itself after run
JacksonBurns Jul 24, 2023
6cf7b7b
more patches for failing arkane tests, fix coverage
JacksonBurns Jul 24, 2023
9644a5e
yet more deprecated documentation
JacksonBurns Jul 24, 2023
2b91035
yet more and more test patches
JacksonBurns Jul 24, 2023
52accd4
final patches for fixing codecov, some np.float warnings
JacksonBurns Jul 24, 2023
c789ca7
update outdated rule in makefile
JacksonBurns Jul 24, 2023
db6bd38
combine tests which were reliant on shared global state
JacksonBurns Jul 24, 2023
f480ee6
update makefile rule and run logs
JacksonBurns Jul 24, 2023
77ded01
fix implicit global state dependence in failing tests
JacksonBurns Jul 24, 2023
79aac12
skip the most dysfunctional tests
JacksonBurns Jul 25, 2023
5c8b679
delete example run output files
JacksonBurns Jul 25, 2023
10a919e
remove windows batch files we can't use anymore
JacksonBurns Jul 25, 2023
9f9500f
add only the required logs and input files
JacksonBurns Jul 25, 2023
a84f61a
remove broken example
JacksonBurns Jul 25, 2023
f2b79e8
patches on patches on patches
JacksonBurns Jul 25, 2023
36e0ff3
initial review comments - see ext
JacksonBurns Jul 26, 2023
2eeff88
Q2DTor - see ext.
JacksonBurns Jul 27, 2023
78a84df
pytest requires skip reason to be a kwarg
JacksonBurns Jul 27, 2023
4388bdc
fix incorrect use of self in hinderedrotor2d test
JacksonBurns Jul 27, 2023
6f1c069
another useful option for running tests in `pytest.ini`
JacksonBurns Jul 27, 2023
3646aad
fix ci reusable workflow to checkout the correct rmg-py
JacksonBurns Jul 28, 2023
5b8ee17
update makefile rule for unit tests
JacksonBurns Aug 1, 2023
46a0b8b
fix bad nosetest rounding conversion
JacksonBurns Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 0 additions & 7 deletions .conda/bld.bat

This file was deleted.

35 changes: 0 additions & 35 deletions .coveragerc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed why .coveragrc is being deleted?

Copy link
Contributor Author

@JacksonBurns JacksonBurns Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ported all the args to the pytest.ini - having a separate coverage config file did not work with python-jl

This file was deleted.

16 changes: 9 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,16 @@ jobs:
run:
shell: bash -l {0}
steps:
- name: Checkout RMG-Py
- name: Checkout RMG-Py - Resuable Workflow
if: github.repository == 'ReactionMechanismGenerator/RMG-database'
uses: actions/checkout@v3
with:
repository: ReactionMechanismGenerator/RMG-Py

- name: Clone RMG-Py - RMG-Py
if: github.repository != 'ReactionMechanismGenerator/RMG-database'
uses: actions/checkout@v3

# configures the mamba environment manager and builds the environment
- name: Setup Mambaforge Python 3.7
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -185,12 +190,9 @@ jobs:
julia -e 'using Pkg; Pkg.add(PackageSpec(name="ReactionMechanismSimulator",rev="main")); using ReactionMechanismSimulator' || true

# non-regression testing
- name: Unit tests
run: make test-unittests
- name: Functional tests
run: make test-functional
- name: Database tests
run: make test-database
- name: Run Unit, Functional, and Database Tests
# aggregate into one command so we only have to eat the collection time once
run: make test-all
rwest marked this conversation as resolved.
Show resolved Hide resolved

# Regression Testing - Test Execution
- name: Regression Tests - Execution
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Patch the environment file
run: |
echo -e "\n - libstdcxx-ng < 13\n" >> environment.yml
cat environment.yml
- name: Setup Mambaforge Python 3.7
uses: conda-incubator/setup-miniconda@v2
with:
Expand Down
30 changes: 23 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ documentation/build/*
# (These will be unique to each developer's setup)
make.inc

# Example output files
examples/*
!examples/*/input.py
!examples/**/*.ipynb
# output files
rmgpy/output/*

# NetBeans project files
nbproject/*
Expand Down Expand Up @@ -76,9 +74,6 @@ bin/symmetry
ipython/*
!ipython/*.ipynb

# Q2DTor
external/Q2DTor

# egg files (pip install -e)
RMG_Py.egg-info/*

Expand All @@ -96,3 +91,24 @@ scripts/treegen_backup.log
test/regression/*
!test/regression/*/input.py
!test/regression/*/regression_input.py

# testing files
test/arkane/data/two_parameter_arrhenius_fit/arkane.log
test/rmgpy/test_data/temp_dir_for_testing/cantera/chem001.yaml
rmgpy/test_data/copied_kinetic_lib/
testing/qm/*
test_log.txt

# example directory - save the inputs but not the outputs
# cantera input files
examples/**/chem.inp
# log files from the runs
examples/**/arkane.log
# results from the runs
examples/**/species_dictionary.txt
examples/**/output*py
examples/**/network*py
examples/**/dictionary.txt
examples/**/reactions.py
examples/**/RMG_libraries
examples/**/species
46 changes: 22 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

.PHONY : all minimal main solver check pycheck arkane clean install decython documentation mopac_travis test
.PHONY : all minimal main solver check pycheck arkane clean install decython documentation test

all: pycheck main solver check

Expand Down Expand Up @@ -40,34 +40,23 @@ clean-solver:
install:
@ python utilities.py check-pydas
python setup.py install

q2dtor:
@ echo -e "\nInstalling Q2DTor...\n"
@ echo -e "Q2DTor is a software for calculating the partition functions and themodynamic properties\
of molecular systems with two or more torsional modes developed by David Ferro Costas (david.ferro@usc.es)\
and Antonio Fernandez Ramos (qf.ramos@usc.es) at the Universidade de Santiago de Compostela. Arkane can\
integrate Q2DTor to compute the quantum mechanical partition function of 2D rotors. \n\nFor use of Q2DTor\
and HinderedRotor2D within Arkane please cite: \n\nD. Ferro-Costas, M. N. D. S.Cordeiro, D. G. Truhlar, A.\
Fernández-Ramos, Comput. Phys. Commun. 232, 190-205, 2018.\n"
@ read -p "Press ENTER to continue" dummy
@ git clone https://github.com/mjohnson541/Q2DTor.git external/Q2DTor --branch arkanepy3

decython:
# de-cythonize all but the 'minimal'. Helpful for debugging in "pure python" mode.
find . -name *.so ! \( -name _statmech.so -o -name quantity.so -o -regex '.*rmgpy/solver/.*' \) -exec rm -f '{}' \;
find . -name *.pyc -exec rm -f '{}' \;

test-all:
nosetests --nocapture --nologcapture --all-modules --verbose --with-coverage --cover-inclusive --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy arkane
python-jl -m pytest

test test-unittests:
nosetests --nocapture --nologcapture --all-modules -A 'not functional' --verbose --with-coverage --cover-inclusive --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy arkane
python-jl -m pytest -m "not functional and not database"

test-functional:
nosetests --nologcapture --all-modules -A 'functional' --verbose --exe rmgpy arkane
python-jl -m pytest -m "functional"

test-database:
nosetests --nocapture --nologcapture --verbose --detailed-errors testing/databaseTest.py
python-jl -m pytest -m "database"

eg0: all
mkdir -p testing/eg0
Expand All @@ -85,25 +74,22 @@ eg1: all
coverage run rmg.py -p testing/eg1/input.py
coverage report
coverage html

eg2: all
mkdir -p testing/eg2
rm -rf testing/eg2/*
cp examples/rmg/1,3-hexadiene/input.py testing/eg2/input.py
coverage erase
@ echo "Running eg2: 1,3-hexadiene example with coverage tracking AND profiling"
coverage run rmg.py -p testing/eg2/input.py
coverage report
coverage html
@ echo "Running eg2: 1,3-hexadiene example with profiling"
python rmg.py -p testing/eg2/input.py

eg3: all
mkdir -p testing/eg3
rm -rf testing/eg3/*
cp examples/rmg/liquid_phase/input.py testing/eg3/input.py
coverage erase
@ echo "Running eg3: liquid_phase example with coverage tracking AND profiling"
coverage run rmg.py -p testing/eg3/input.py
coverage report
coverage html
@ echo "Running eg3: liquid_phase example with profiling"
python rmg.py -p testing/eg3/input.py

eg5: all
mkdir -p testing/eg5
Expand Down Expand Up @@ -140,3 +126,15 @@ eg4: all
cp examples/thermoEstimator/input.py testing/eg4/input.py
@ echo "Running thermo data estimator example. This tests QM."
python scripts/thermoEstimator.py testing/eg4/input.py

q2dtor:
@ echo -e "\nInstalling Q2DTor...\n"
@ echo -e "Q2DTor is a software for calculating the partition functions and themodynamic properties\
of molecular systems with two or more torsional modes developed by David Ferro Costas (david.ferro@usc.es)\
and Antonio Fernandez Ramos (qf.ramos@usc.es) at the Universidade de Santiago de Compostela. Arkane can\
integrate Q2DTor to compute the quantum mechanical partition function of 2D rotors. \n\nFor use of Q2DTor\
and HinderedRotor2D within Arkane please cite: \n\nD. Ferro-Costas, M. N. D. S.Cordeiro, D. G. Truhlar, A.\
Fernández-Ramos, Comput. Phys. Commun. 232, 190-205, 2018.\n"
@ read -p "Press ENTER to continue" dummy
@ mkdir -p external
@ git clone https://github.com/cathedralpkg/Q2DTor external/Q2DTor
Loading
Loading