diff --git a/integrationtests/filldb.sh b/integrationtests/filldb.sh index 98d22347bd2d40e8384a2a217452fd3ba5bc445f..9f55365eb595537b43caa9b197c8bc31ea1e69cb 100755 --- a/integrationtests/filldb.sh +++ b/integrationtests/filldb.sh @@ -7,4 +7,5 @@ python3 -m caosadvancedtools.loadFiles /opt/caosdb/mnt/extroot/SimulationData python3 -m caosadvancedtools.loadFiles /opt/caosdb/mnt/extroot/Publications python3 -m caosadvancedtools.loadFiles /opt/caosdb/mnt/extroot/Software python3 insert_model.py +python3 insert_some.py python3 crawl.py / diff --git a/integrationtests/insert_some.py b/integrationtests/insert_some.py new file mode 100644 index 0000000000000000000000000000000000000000..f5b32af13d9b2d7af5957eb4ae005b0798bf9dfc --- /dev/null +++ b/integrationtests/insert_some.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +import caosdb as db +from caosadvancedtools.scifolder.experiment_cfood import dm + +# This inserts two identifiables. When no dependencies are possible among +# identifiables, it should not be possible to find both: the experiment +# identifiable would for example not reference the correct project Record +project = db.Record(name='2010_TestProject') +project.add_parent(name=dm.Project) +project.insert() + +experiment = db.Record() +experiment.add_parent(name=dm.Experiment) +experiment.add_property( + name=dm.date, value='2019-02-03') +experiment.add_property(name=dm.Project, value=project) +experiment.add_property( + name="identifier", value="empty_identifier") +experiment.insert() diff --git a/integrationtests/model.yml b/integrationtests/model.yml index 0a4ad381bfc119dd65d2c192f8de823deda525ae..73609a7a2fcde5c2802bac64736726c9d663d726 100644 --- a/integrationtests/model.yml +++ b/integrationtests/model.yml @@ -1,5 +1,5 @@ Experiment: - obligatory_properties: + recommended_properties: date: datatype: DATETIME description: 'date of the experiment' diff --git a/integrationtests/test.sh b/integrationtests/test.sh index a56b758421a059a0cc3461c08600c13ffd93705c..80a2afe307ab1da628faa39d4ba8ef93bc6959e4 100755 --- a/integrationtests/test.sh +++ b/integrationtests/test.sh @@ -3,6 +3,7 @@ OUT=/tmp/crawler.output ls cat pycaosdb.ini rm -rf cache.db +set -e echo "Clearing database" python3 clear_database.py echo "Testing crawler without cfoods" @@ -29,7 +30,6 @@ echo "run crawler" # rename the moved file mv extroot/DataAnalysis/2010_TestProject/2019-02-03_something/README.xlsx_back extroot/DataAnalysis/2010_TestProject/2019-02-03_something/README.xlsx # check whether there was something UNAUTHORIZED -set -e grep "There where unauthorized changes" $OUT # get the id of the run which is the last field of the output string RUN_ID=$(grep "run id:" $OUT | awk '{ print $NF }')