Skip to content
Snippets Groups Projects
Commit d3cce122 authored by felmer's avatar felmer
Browse files

integration tests: fixing test-3v.sh

SVN: 26765
parent bc9776e1
No related branches found
No related tags found
No related merge requests found
...@@ -335,12 +335,12 @@ function fetch_latest_artifacts_from_cruise_control { ...@@ -335,12 +335,12 @@ function fetch_latest_artifacts_from_cruise_control {
local last_build="$HUDSON_ARTIFACTS/$proj_name/lastSuccessful/archive/_main/targets/dist" local last_build="$HUDSON_ARTIFACTS/$proj_name/lastSuccessful/archive/_main/targets/dist"
if [ -n "$MY_HOST_IP" -a "$MY_HOST_IP" == "$CI_HOST_IP" ]; then if [ -n "$MY_HOST_IP" -a "$MY_HOST_IP" == "$CI_HOST_IP" ]; then
local last=`ls $CI_HOME/$last_build/*.zip` local last=`ls $CI_HOME/$last_build/*.zip`
echo "Fetching artifacts locally from project '$proj_name':\n$last" echo "Fetching artifacts locally from project '$proj_name':$last"
cp $CI_HOME/$last_build/*.zip $dest_dir cp $CI_HOME/$last_build/*.zip $dest_dir
else else
local list_cmd="ls $last_build/*.zip" local list_cmd="ls $last_build/*.zip"
local last=`echo $list_cmd | ssh $SSH_CRUISE_CONTROL_NAME -T` local last=`echo $list_cmd | ssh $SSH_CRUISE_CONTROL_NAME -T`
echo "Fetching artifacts remotely from project '$proj_name':\n$last" echo "Fetching artifacts remotely from project '$proj_name':$last"
scp $SSH_CRUISE_CONTROL_NAME:$last_build/*.zip $dest_dir scp $SSH_CRUISE_CONTROL_NAME:$last_build/*.zip $dest_dir
fi fi
} }
......
...@@ -38,7 +38,7 @@ function generate_test_data { ...@@ -38,7 +38,7 @@ function generate_test_data {
echo Generate incoming data echo Generate incoming data
local DIR=$DATA/in-raw local DIR=$DATA/in-raw
# drop an identifyable valid data set # drop an identifiable valid data set
copy_test_data 3VCP1 $DIR copy_test_data 3VCP1 $DIR
sleep 30 sleep 30
...@@ -46,21 +46,14 @@ function generate_test_data { ...@@ -46,21 +46,14 @@ function generate_test_data {
copy_test_data 3VCP1 $DIR copy_test_data 3VCP1 $DIR
sleep 30 sleep 30
# drop an identifyable invalid data set (wrong image name, missing plate) # drop another identifiable valid data set
copy_test_data 3VCP3 $DIR copy_test_data 3VCP3 $DIR
sleep 30 sleep 30
# drop an unidentifyable data set # drop an unidentifiable data set
copy_test_data UnknownPlate $DIR copy_test_data UnknownPlate $DIR
sleep 30 sleep 30
# drop 3VCP1 again but this time it is a valid data set
copy_test_data 3VCP3 $DATA
mv $DATA/3VCP3/TIFF/blabla_3VCP1_K13_8_w460.tif $DATA/3VCP3/TIFF/blabla_3VCP3_K13_8_w460.tif
echo image for well M03 > $DATA/3VCP3/TIFF/blabla_3VCP3_M03_2_w350.tif
mv $DATA/3VCP3 $DIR
sleep 30
# register not at a sample but at an experiment and two data set parents # register not at a sample but at an experiment and two data set parents
echo hello world > $DATA/incoming-a/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3.txt echo hello world > $DATA/incoming-a/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3.txt
# give the DSS some time to process the above request # give the DSS some time to process the above request
...@@ -99,17 +92,17 @@ function launch_tests { ...@@ -99,17 +92,17 @@ function launch_tests {
} }
function find_dataset_dir { function find_dataset_dir {
local pattern=$1 local pattern=$1
local dir=`find $DATA/main-store/1/E96C8910-596A-409D-BDA4-BBD3FE6629A7 -type d | grep "$pattern"` local dir=`find $DATA/main-store/1/E96C8910-596A-409D-BDA4-BBD3FE6629A7 -type d | grep "$pattern"`
if [ "$dir" != "" ]; then if [ "$dir" != "" ]; then
if [ ! -d "$dir" ]; then if [ ! -d "$dir" ]; then
report_error Directory \"$dir\" does not exist! report_error Directory \"$dir\" does not exist!
else else
echo $dir echo $dir
return return
fi fi
fi fi
report_error "$DATA/main-store/1/identified does not contain a directory matching $pattern: $dir" report_error "$DATA/main-store/1/E96C8910-596A-409D-BDA4-BBD3FE6629A7 does not contain a directory matching $pattern: $dir"
} }
function assert_empty_in_out_folders { function assert_empty_in_out_folders {
...@@ -169,25 +162,24 @@ function assert_correct_content { ...@@ -169,25 +162,24 @@ function assert_correct_content {
assert_empty_in_out_folders assert_empty_in_out_folders
assert_dir_exists $DATA/out-raw/microX_200801011213_3VCP1/TIFF assert_dir_exists $DATA/out-raw/microX_200801011213_3VCP1/TIFF
assert_pattern_present $DATA/out-raw/.faulty_paths 1 ".*data/out-raw/.MARKER_is_finished_microX_200801011213_3VCP1" assert_pattern_present $DATA/out-raw/.faulty_paths 1 ".*data/out-raw/.MARKER_is_finished_microX_200801011213_3VCP1"
assert_pattern_present $WORK/datamover-raw/data-completed-info.txt 4 "Data complete.*3VCP[0-9]" assert_pattern_present $WORK/datamover-raw/data-completed-info.txt 3 "Data complete.*3VCP[0-9]"
assert_correct_content_of_plate_3VCP1_in_store assert_correct_content_of_plate_3VCP1_in_store
assert_correct_content_of_image_analysis_data 3VCP1 ".*-22.*3VCP1$" assert_correct_content_of_image_analysis_data 3VCP1 ".*-24.*3VCP1$"
assert_correct_content_of_image_analysis_data 3VCP3 ".*-24.*3VCP3$" assert_correct_content_of_image_analysis_data 3VCP3 ".*-26.*3VCP3$"
assert_correct_content_of_unidentified_plate_in_store UnknownPlate assert_correct_content_of_unidentified_plate_in_store UnknownPlate
local file=`find_dataset_dir ".*-27$"`/original/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3.txt local file=`find_dataset_dir ".*-28$"`/original/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3.txt
assert_equals_as_in_file "hello world" $file assert_equals_as_in_file "hello world" $file
# result set columns are # result set columns are
# id;experiment_code;data_store_code;code;is_placeholder;data_id_parent;is_complete;data_producer_code;production_timestamp # id;experiment_code;data_store_code;code;is_placeholder;data_id_parent;is_complete;data_producer_code;production_timestamp
assert_correct_dataset_content_in_database 2 "2;EXP1;DSS1;MICROX-3VCP1;f;;U;microX;2008-01-01.*" assert_correct_dataset_content_in_database 2 "2;EXP1;DSS1;MICROX-3VCP1;f;;U;microX;2008-01-01.*"
assert_correct_dataset_content_in_database 3 "3;EXP1;DSS1;20[0-9]*-22;f;;U;;" assert_correct_dataset_content_in_database 3 "3;EXP1;DSS1;20[0-9]*-24;f;;U;;"
assert_correct_dataset_content_in_database 4 "4;EXP1;DSS1;20[0-9]*-23;f;;U;;" assert_correct_dataset_content_in_database 4 "4;EXP1;DSS1;20[0-9]*-25;f;;U;;"
assert_correct_dataset_content_in_database 5 "5;EXP1;DSS1;MICROX-3VCP3;f;;U;microX;2008-01-01.*" assert_correct_dataset_content_in_database 5 "5;EXP1;DSS1;MICROX-3VCP3;f;;U;microX;2008-01-01.*"
assert_correct_dataset_content_in_database 6 "6;EXP1;DSS1;20[0-9]*-24;f;;U;;" assert_correct_dataset_content_in_database 6 "6;EXP1;DSS1;20[0-9]*-26;f;;U;;"
assert_correct_dataset_content_in_database 7 "7;EXP1;DSS1;20[0-9]*-26;f;;U;;" assert_correct_dataset_content_in_database 7 ".*7;EXP1;DSS2;20[0-9]*-28;f;2;U;;.*"
assert_correct_dataset_content_in_database 8 ".*8;EXP1;DSS2;20[0-9]*-27;f;2;U;;.*" assert_correct_dataset_content_in_database 7 ".*7;EXP1;DSS2;20[0-9]*-28;f;5;U;;.*"
assert_correct_dataset_content_in_database 8 ".*8;EXP1;DSS2;20[0-9]*-27;f;5;U;;.*" assert_equals "Content of file in drop box1" "hello world" "`cat $DATA/drop-box1/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3*-28.txt`"
assert_equals "Content of file in drop box1" "hello world" "`cat $DATA/drop-box1/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3*-27.txt`" assert_equals "Content of file in drop box2" "hello world" "`cat $DATA/drop-box2/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3*-28.txt`"
assert_equals "Content of file in drop box2" "hello world" "`cat $DATA/drop-box2/nemo.exp1_MICROX-3VCP1.MICROX-3VCP3*-27.txt`"
} }
function print_help { function print_help {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment