You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to be able to run checks in python without spinning up the java engine (and going through the dispatcher).
In the checks module, add a new function run_checks that can take a check and the desired document and return an output. There may be checks where multiple output and statuses are returned, so we may want to consider returning a dictionary.
The text was updated successfully, but these errors were encountered:
Greetings @jeanetteclark, I was able to get the run_check pytest working successfully! I ended up refactoring some pytests as well, and running pytest will now execute all tests successfully in the feature-13-runcheck branch. What's left to do is code clean-up, and also returning a dictionary of the results.
Also, do you happen to have a python check handy that will run and return more than one result? I may not fully understand that process - but I will look for a check after I've wrapped up my to-do items.
In terms of making checks easier to test, I suggest that we create a metadig command line client - similar to how we have one for hashstore, which gets installed when we execute poetry install. It will take arguments which will run the run_check function - I imagine the process to test a check to look something like this:
# Check-out hashstore and install it
$ cd~/Code/hashstore
~/Code/hashstore $ poetry install
# Create a HashStore at your desired store path (ex. /docs/dou/hashstore)~/Code/hashstore $ hashstore /path/to/store/ -chs -dp=3 -wp=2 -ap=SHA-256 -nsp=\"http://www.ns.test/v1\"# Store data object and associated metadata documents for the check~/Code/hashstore $ hashstore /path/to/store/ -storeobject -pid=persistent_identifier -path=/path/to/object\n~/Code/hashstore
~/Code/hashstore $ hashstore /path/to/store/ -storemetadata -pid=persistent_identifier -path=/path/to/metadata/object -formatid=https://ns.dataone.org/service/types/v2.0#SystemMetadata
# Run check# `store_path` will be used to retrieve the hashstore location and get `StoreManager` properties# `data_pids` will pass the data pids to run the checks against# A `check_vars` dictionary will be created to be passed onto `run_check` in the metadig client
$ cd~/Code/metadig-py
~/Code/metadig-py $ metadig -runcheck -store_path=/path/to/store -check_xml=path/to/check/xml/check.xml -eml_doc=path/to/eml/metadata/doc data_pids=[array,of,pids]
# Results will be printed to stdout
If this sounds good to you, I can add that as part of this feature branch (or I could also create a new sub-issue for it).
We would like to be able to run checks in python without spinning up the java engine (and going through the dispatcher).
In the
checks
module, add a new functionrun_checks
that can take a check and the desired document and return an output. There may be checks where multiple output and statuses are returned, so we may want to consider returning a dictionary.The text was updated successfully, but these errors were encountered: