diff --git a/integrationtests/create_analysis.py b/integrationtests/create_analysis.py index 44e99c9848a4c75fd80e419452be1eda087b3230..40abc07220d310e066f5c55fe0c896012c3f1d31 100644 --- a/integrationtests/create_analysis.py +++ b/integrationtests/create_analysis.py @@ -24,26 +24,23 @@ # """ -module description +A small script that creates an Analysis Record that can be used for testing the +automated analysis pipeline. """ import sys +from datetime import datetime import caosdb as db def main(): - # TODO remove fixed path script = db.File( file="../src/caosadvancedtools/serverside/examples/example_script.py", - path="Analysis/scripts/example_script.py", + path=("AutomatedAnalysis/scripts/" + + str(datetime.now())+"example_script.py"), ) - try: - script.insert() - except: - script = db.execute_query( - "FIND FILE which is stored at 'Analysis/scripts/example_script.py'", - unique=True) + script.insert() da = db.Record() da.add_parent("Analysis") @@ -52,7 +49,6 @@ def main(): value=db.execute_query( "FIND FILE which is stored at '**/timeseries.npy'", unique=True), - # datatype=db.LIST(db.FILE) ) da.add_property("date", "2020-01-01") da.add_property("identifier", "TEST") diff --git a/integrationtests/test.sh b/integrationtests/test.sh index 9cf17be452a77f2ad0cbc827b9d4c49382098111..1c0357e265eec770069166e614fc0a3aa6ecc548 100755 --- a/integrationtests/test.sh +++ b/integrationtests/test.sh @@ -67,6 +67,8 @@ echo "Testing im and export" python3 test_im_und_export.py # automated analysis +# for some reason the loadFiles of sim data has to be called again +python3 -m caosadvancedtools.loadFiles /opt/caosdb/mnt/extroot/SimulationData python3 create_analysis.py # Better safe than sorry: diff --git a/integrationtests/update_analysis.py b/integrationtests/update_analysis.py index 3fd9840ac6cce6844670f3147649c034c405ba7f..9c2adf5f2c19e356b562fd62eb50c62cd8adf6b1 100644 --- a/integrationtests/update_analysis.py +++ b/integrationtests/update_analysis.py @@ -24,7 +24,12 @@ # """ -module description +Exemplary update script. An anlysis Record is retrieved and passed to the +generic run function which then calls the appropriate script based on the +Record. + +The simple query here could be replaced with something that e.g. retrieves all +entities that where changed within a certain period of time. """ import sys