From 51073638a289aeb6aec4e5cdf2f5954827531782 Mon Sep 17 00:00:00 2001 From: tpylak <tpylak> Date: Tue, 29 Sep 2009 08:37:46 +0000 Subject: [PATCH] SE-133 YeastX - fix integration tests: make tests more stable by sorting the incoming datasets SVN: 12749 --- integration-tests/test-yeastx.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/integration-tests/test-yeastx.sh b/integration-tests/test-yeastx.sh index 09bee2b4643..06d4d313196 100755 --- a/integration-tests/test-yeastx.sh +++ b/integration-tests/test-yeastx.sh @@ -15,21 +15,33 @@ METABOL_DB=metabol_dev # -------------------- +# Changes last-modification-time so that the order is the same as the alphabetical order. +function change_modification_time_alphabetically { + local dir=$1 + + local file + # modification data format: YYYYMMDDhhmm + local modification_time=200811221122 + for file in `ls -1 $dir | sort`; do + local full_path=$dir/$file + # change the modification date format + touch -t $modification_time $full_path + modification_time=$(($modification_time+1)) + done +} + # Prepare template incoming data and some destination data structures function prepare_data { # Prepare empty incoming data rm -fr $MY_DATA mkdir -p $MY_DATA local SRC=$TEMPLATE/data-yeastx - local file - # Copy the files in the alphabetical order, so the last-modification-time order is the same. - # DSS processes files ordered by modification time, so in this way we make the tests more predictable. - for file in `ls -1 $SRC | sort`; do - cp -R $TEMPLATE/data-yeastx/$file $MY_DATA/ - done + cp -R $SRC/* $MY_DATA/ clean_svn $MY_DATA - + chmod -R 700 $MY_DATA/incoming* + # DSS processes files ordered by modification time, so in this way we make the tests more predictable. + change_modification_time_alphabetically $MY_DATA/incoming } -- GitLab