Skip to content

Commit

Permalink
Added test_deps for cm-scripts, mlcommons#275
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Sep 7, 2022
1 parent 63c1e6d commit 9f48b14
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-cm-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ jobs:
- name: Test CM Script
run: |
python tests/script/test_install.py
python tests/script/test_deps.py
18 changes: 18 additions & 0 deletions tests/script/test_deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This test covers version, variation, compilation from src, add_deps_recursive, post_deps
try:
import cmind as cm

r = cm.access({'action':'run', 'automation':'script', 'tags': 'generate-run-cmds,mlperf', 'add_deps_recursive':
{'inference-src': {'tags': '_octoml'}, 'loadgen': {'version': 'r2.1'}}, 'env': {'CM_MODEL': 'resnet50',
'CM_DEVICE': 'cpu', 'CM_BACKEND': 'onnxruntime'}})
if 'return' not in r:
raise Exception('CM access function should always return key \'return\'!')
if 'error' in r:
raise Exception(r['error'])

exit(0)

except ImportError as e:
from sys import stderr
print('CM module for python is not installed', file=stderr)
exit(1)
1 change: 1 addition & 0 deletions tests/script/test_install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This test covers script installation, version, shared library install
try:
import cmind as cm

Expand Down

0 comments on commit 9f48b14

Please sign in to comment.