Skip to content

Commit

Permalink
Merge pull request #154 from MolSSI-MDI/conda
Browse files Browse the repository at this point in the history
Add conda test
  • Loading branch information
taylor-a-barnes authored Jul 21, 2023
2 parents 9f43cfb + 739f5f0 commit c1444ff
Show file tree
Hide file tree
Showing 28 changed files with 154 additions and 1 deletion.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ jobs:
ls
# Enable tmate debugging of manually-triggered workflows if the input option was provided
# To execute: Click the GitHub "Actions" tab, then "CI", then "Run Workflow", then set debugging to "true"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
Expand All @@ -336,3 +337,82 @@ jobs:
run: |
codecov.exe -f coverage.xml -t "99465b5f-26b4-4487-8355-fbcac5249a05"
# Build for posix systems
conda:

strategy:
fail-fast: false
matrix:
platform: [ ubuntu-latest ]
mpilib: [null]

# The type of runner that the job will run on
runs-on: ${{ matrix.platform }}

env:
OMPI_MCA_btl_base_warn_component_unused: "0"
CODECOV_TOKEN: "99465b5f-26b4-4487-8355-fbcac5249a05"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Install Miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""

- name: Create source file with all required environment variables
shell: bash -el {0}
run: |
# Create a source file that will contain environment variables used in additional steps
# Environment variabls are not normally preserved between steps, so the source file is necessary
touch env.source
# Set MDI_TESTS, which defines which tests will be performed for this job
[ "${{ matrix.mpilib }}" == "" ] && echo 'export MDI_TESTS="not mpi"' >> env.source
cat env.source
- name: Install dependencies
shell: bash -el {0}
run: |
source env.source
sudo apt-get clean
sudo apt-get update
sudo apt-get install gfortran
conda install -y -c conda-forge numpy
conda install -y -c conda-forge pytest
conda install -y -c conda-forge pymdi
- name: Install local build
shell: bash -el {0}
run: |
source env.source
mkdir build
cd build
cmake -Dtest_codes=ON -DCMAKE_INSTALL_PREFIX=./install ..
make VERBOSE=1
#make install
rm MDI_Library/__init__.py
rm MDI_Library/mdi.py
ls
ls MDI_Library
# Enable tmate debugging of manually-triggered workflows if the input option was provided
# To execute: Click the GitHub "Actions" tab, then "CI", then "Run Workflow", then set debugging to "true"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Run test scripts
shell: bash -el {0}
run: |
source env.source
conda list
cd tests
pytest -vv -k "${MDI_TESTS}"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/driver_plug_py/driver_plug_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/driver_py/driver_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/engine_py/engine_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/lib_py/lib_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_double.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_fake_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_fake_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_fake_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_no_hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_no_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_no_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_no_port_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_no_port_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_no_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_hostname.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_init_noarg_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
1 change: 1 addition & 0 deletions tests/MDI_Test_Codes/misc_py/ut_tmethod.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

try: # Check for local build
import MDI_Library as mdi
testvar = mdi.MDI_COMMAND_LENGTH
except: # Check for installed package
import mdi

Expand Down
6 changes: 5 additions & 1 deletion tests/test_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def import_mdi():
try: # Check for local build
sys.path.append('../build')
import MDI_Library as mdi
try:
testvar = mdi.MDI_COMMAND_LENGTH
except AttributeError:
import mdi
except ImportError: # Check for installed package
import mdi
return mdi
Expand All @@ -41,4 +45,4 @@ def test_atomic_number_unrecognized():
mdi = import_mdi()

with pytest.raises(Exception):
mdi.MDI_String_to_atomic_number("YY")
mdi.MDI_String_to_atomic_number("YY")
4 changes: 4 additions & 0 deletions tests/test_uninit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def import_mdi():
try: # Check for local build
sys.path.append('../build')
import MDI_Library as mdi
try:
testvar = mdi.MDI_COMMAND_LENGTH
except AttributeError:
import mdi
except ImportError: # Check for installed package
import mdi
return mdi
Expand Down
4 changes: 4 additions & 0 deletions tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def import_mdi():
try: # Check for local build
sys.path.append('../build')
import MDI_Library as mdi
try:
testvar = mdi.MDI_COMMAND_LENGTH
except AttributeError:
import mdi
except ImportError: # Check for installed package
import mdi
return mdi
Expand Down
38 changes: 38 additions & 0 deletions tests/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,41 @@
fun:start_thread
fun:clone
}


{
Leak from test import
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_PyMem_RawMalloc
fun:PyObject_Malloc
fun:PyFloat_FromDouble
fun:fill_time
fun:_pystat_fromstructstat
fun:posix_do_stat
fun:os_stat_impl
fun:os_stat
fun:cfunction_vectorcall_FASTCALL_KEYWORDS
fun:_PyObject_VectorcallTstate
fun:PyObject_Vectorcall
}


{
Leak from test import 2
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_PyMem_RawMalloc
fun:PyObject_Malloc
fun:PyFloat_FromDouble
fun:float_abs
fun:PyNumber_Absolute
fun:builtin_abs
fun:cfunction_vectorcall_O
fun:_PyObject_VectorcallTstate
fun:PyObject_Vectorcall
fun:call_function
fun:_PyEval_EvalFrameDefault
}

0 comments on commit c1444ff

Please sign in to comment.