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

Added more tests, #275 #298

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions tests/script/test_deps.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# This test covers version, variation, compilation from src, add_deps_recursive, post_deps
# This test covers version, variation, compilation from src, add_deps, add_deps_recursive, deps, post_deps

import cmind as cm

def check_return(r):
if 'return' not in r:
raise Exception('CM access function should always return key \'return\'!')
if 'error' in r:
raise Exception(r['error'])

def check_list(r, str):
check_return(r)
if 'list' not in r:
raise Exception('CM search should return a list!')
if len(r['list']) < 1:
raise Exception('CM search returned an empty list for ' + str)

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

r = cm.access({'action':'search', 'automation': 'cache', 'tags': 'loadgen,version-r2.1,deps-python-non-virtual'})
check_list(r, "loadgen,version-r2.1,deps-python-non-virtual")

r = cm.access({'action':'search', 'automation': 'cache', 'tags': 'inference,src,version-r2.1'})
check_list(r, "inference,src,version-r2.1")