Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf committed Mar 11, 2024
1 parent b8550d5 commit 6553887
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 49 deletions.
6 changes: 6 additions & 0 deletions recipe/build_openmm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ pushd openmm-cuda
popd
LIB_SDIR=".libs" repair

rm -rf $PREFIX/lib/plugins
rm -rf $PREFIX/lib/libOpenMM
rm -rf $PREFIX/include/openmm
rm -rf $PREFIX/include/lepton
rm -rf $PREFIX/share/openmm

# Copy the wheel to destination
for whl in fixed_wheels/*.whl; do
if [[ "$build_platform" == "osx-"* ]]; then
Expand Down
49 changes: 0 additions & 49 deletions recipe/test_openmm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
set -ex
with_cuda="no"

# Existence tests
test -f $PREFIX/lib/libOpenMM$SHLIB_EXT
test -f $PREFIX/lib/plugins/libOpenMMCPU$SHLIB_EXT
test -f $PREFIX/lib/plugins/libOpenMMPME$SHLIB_EXT
test -f $PREFIX/lib/plugins/libOpenMMOpenCL$SHLIB_EXT
if [[ "$target_platform" == linux-64 || "$target_platform" == linux-ppc64le ]]; then
with_cuda="yes"
test -f $PREFIX/lib/plugins/libOpenMMCUDA$SHLIB_EXT
fi

## Do they work properly?
# Debug silent errors in plugin loading
python -c "import openmm as mm; print('---Loaded---', *mm.pluginLoadedLibNames, '---Failed---', *mm.Platform.getPluginLoadFailures(), sep='\n')"
Expand All @@ -34,17 +24,6 @@ fi
# testing cuda 12 changes, see https://github.com/conda-forge/openmm-feedstock/pull/108#issuecomment-1692190752
#python -c "from openmm import Platform as P; n = P.getNumPlatforms(); assert n == $n_platforms, f'n_platforms ({n}) != $n_platforms'"

# Run a small MD
cd ${PREFIX}/share/openmm/examples
python benchmark.py --test=rf --seconds=10 --platform=Reference
python benchmark.py --test=rf --seconds=10 --platform=CPU
if [[ -z ${CI-} ]]; then # Run only outside CI, assuming there will be a GPU there
python benchmark.py --test=rf --seconds=10 --platform=OpenCL
if [[ $with_cuda == yes ]]; then
python benchmark.py --test=rf --seconds=10 --platform=CUDA
fi
fi

# Check version metadata looks ok, only for final releases, RCs are not checked!
if [[ ${PKG_VERSION} != *"rc"* && ${PKG_VERSION} != *"beta"* && ${PKG_VERSION} != *"dev"* ]]; then
python -c "from openmm import Platform; v = Platform.getOpenMMVersion(); assert \"$PKG_VERSION\" in (v, v+'.0'), v + \"!=$PKG_VERSION\""
Expand All @@ -56,34 +35,6 @@ else
fi

if [[ $with_test_suite == "true" ]]; then
cd $PREFIX/share/openmm/tests
set +ex

# C++ tests
summary=""; exitcode=0; count=0;
for f in Test*; do
if [[ -n ${CI-} && ( $f == *Cuda* || $f == *OpenCL* ) ]]; then continue; fi
((count+=1))
echo -e "\n#$count: $f"
# Retry three times so stochastic tests have a chance
attempts=0
while true; do
./${f}
thisexitcode=$?
((attempts+=1))
if [[ $thisexitcode == 0 || $attempts == 3 ]]; then break; fi
done
if [[ $thisexitcode != 0 ]]; then summary+="\n#$count ${f}"; fi
((exitcode+=$thisexitcode))
done
if [[ $exitcode != 0 ]]; then
echo "------------"
echo "Failed tests"
echo "------------"
echo -e "${summary}"
exit $exitcode
fi

# Python tests
set -ex
cd python
Expand Down

0 comments on commit 6553887

Please sign in to comment.