From 27e668a3cbbb7bfbef3b8eb45c6b1d2e335826d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 26 Jul 2018 13:52:24 +0300 Subject: [PATCH 1/6] Set test timeout to 900 seconds Any test that takes longer than 15 minutes to run is too long and should explicitly set a longer timeout. --- maxscale-system-test/utilities.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maxscale-system-test/utilities.cmake b/maxscale-system-test/utilities.cmake index 5bd8d6444..bc885aeea 100644 --- a/maxscale-system-test/utilities.cmake +++ b/maxscale-system-test/utilities.cmake @@ -4,6 +4,9 @@ function(add_template name template) set(CNF_TEMPLATES "${CNF_TEMPLATES}{\"${name}\",\"${template}\"}," CACHE INTERNAL "") endfunction() +# Default test timeout +set(TIMEOUT 900) + # This functions adds a source file as an executable, links that file against # the common test core and creates a test from it. The first parameter is the # source file, the second is the name of the executable and the test and the @@ -26,6 +29,7 @@ function(add_test_executable source name template) get_property(prev_labels TEST ${name} PROPERTY LABELS) set_property(TEST ${name} PROPERTY LABELS ${label} ${prev_labels}) endforeach() + set_property(TEST ${name} PROPERTY TIMEOUT ${TIMEOUT}) endfunction() # Same as add_test_executable, but do not add executable into tests list @@ -39,6 +43,7 @@ endfunction() function(add_test_derived name executable template) add_template(${name} ${template}) add_test(NAME ${name} COMMAND ${CMAKE_BINARY_DIR}/${executable} ${name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + set_property(TEST ${name} PROPERTY TIMEOUT ${TIMEOUT}) list(REMOVE_AT ARGV 0 1 2) @@ -61,6 +66,7 @@ function(add_test_script name script template labels) get_property(prev_labels TEST ${name} PROPERTY LABELS) set_property(TEST ${name} PROPERTY LABELS ${label} ${prev_labels}) endforeach() + set_property(TEST ${name} PROPERTY TIMEOUT ${TIMEOUT}) endfunction() # Label a list of tests as heavy, long running tests From ba680b674d329a5e793db5c72f9fe98b5e691aad Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Mon, 23 Jul 2018 14:23:52 +0300 Subject: [PATCH 2/6] do not call mdbci repo config in build.sh and upgrade_test.sh --- BUILD/mdbci/copy_repos.sh | 2 ++ BUILD/mdbci/templates/install.json.template | 3 ++- BUILD/mdbci/upgrade_test.sh | 11 ++--------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/BUILD/mdbci/copy_repos.sh b/BUILD/mdbci/copy_repos.sh index 4d84c5e3c..3c6699d9d 100755 --- a/BUILD/mdbci/copy_repos.sh +++ b/BUILD/mdbci/copy_repos.sh @@ -38,3 +38,5 @@ $(<${script_dir}/templates/repository-config/deb.json.template) " 2> /dev/null > ${path_prefix}/${platform}_${platform_version}.json fi cd $dir + +${mdbci_dir}/mdbci generate-product-repositories --product maxscale_ci diff --git a/BUILD/mdbci/templates/install.json.template b/BUILD/mdbci/templates/install.json.template index 39c265c97..aa9715d71 100644 --- a/BUILD/mdbci/templates/install.json.template +++ b/BUILD/mdbci/templates/install.json.template @@ -5,7 +5,8 @@ "box" : "$box", "memory_size" : "4096", "product" : { - "name": "maxscale" + "name" : "maxscale", + "version" : "${old_target}" } } diff --git a/BUILD/mdbci/upgrade_test.sh b/BUILD/mdbci/upgrade_test.sh index 04e92925b..5de7c681f 100755 --- a/BUILD/mdbci/upgrade_test.sh +++ b/BUILD/mdbci/upgrade_test.sh @@ -33,9 +33,6 @@ if [ -d "install_$box" ]; then ${mdbci_dir}/mdbci destroy $name fi -${mdbci_dir}/repository-config/generate_all.sh repo.d -${mdbci_dir}/repository-config/maxscale-release.sh $old_target repo.d - # starting VM for build ${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json --repo-dir $dir/repo.d generate $name ${mdbci_dir}/mdbci up $name --attempts=1 @@ -61,12 +58,8 @@ export sshopt="$scpopt $sshuser@$IP" old_version=`ssh $sshopt "maxscale --version" ` -rm -rf repo.d -${mdbci_dir}/repository-config/generate_all.sh repo.d -${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d - -${mdbci_dir}/mdbci setup_repo --product maxscale --repo-dir $dir/repo.d $name/maxscale -${mdbci_dir}/mdbci install_product --product maxscale $name/maxscale +${mdbci_dir}/mdbci setup_repo --product maxscale_ci --product-version ${new_target} $name/maxscale +${mdbci_dir}/mdbci install_product --product maxscale_ci $name/maxscale res=$? From 81507349f3263a209e26d8f01fd6c345dece68b8 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Mon, 23 Jul 2018 14:57:33 +0300 Subject: [PATCH 3/6] remove reference to repo.d from upgrade_test --- BUILD/mdbci/upgrade_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/mdbci/upgrade_test.sh b/BUILD/mdbci/upgrade_test.sh index 5de7c681f..e369f4e32 100755 --- a/BUILD/mdbci/upgrade_test.sh +++ b/BUILD/mdbci/upgrade_test.sh @@ -34,7 +34,7 @@ if [ -d "install_$box" ]; then fi # starting VM for build -${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json --repo-dir $dir/repo.d generate $name +${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json generate $name ${mdbci_dir}/mdbci up $name --attempts=1 if [ $? != 0 ] ; then if [ $? != 0 ] ; then From d6be2cb70d0dbecfb6895222fc7f213d74e23725 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Mon, 23 Jul 2018 15:22:43 +0300 Subject: [PATCH 4/6] fix typo in upgrade_test --- BUILD/mdbci/upgrade_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/mdbci/upgrade_test.sh b/BUILD/mdbci/upgrade_test.sh index e369f4e32..fbac44d70 100755 --- a/BUILD/mdbci/upgrade_test.sh +++ b/BUILD/mdbci/upgrade_test.sh @@ -58,7 +58,7 @@ export sshopt="$scpopt $sshuser@$IP" old_version=`ssh $sshopt "maxscale --version" ` -${mdbci_dir}/mdbci setup_repo --product maxscale_ci --product-version ${new_target} $name/maxscale +${mdbci_dir}/mdbci setup_repo --product maxscale_ci --product-version ${target} $name/maxscale ${mdbci_dir}/mdbci install_product --product maxscale_ci $name/maxscale res=$? From d59917673da9d8c1986a5ca635b50c32b3c1e432 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 25 Jul 2018 13:02:20 +0300 Subject: [PATCH 5/6] do not generate repo.d in run_test --- maxscale-system-test/mdbci/create_config.sh | 8 +------- maxscale-system-test/mdbci/run_test_snapshot.sh | 9 ++------- maxscale-system-test/mdbci/templates/big.json.template | 3 ++- maxscale-system-test/mdbci/templates/big15.json.template | 3 ++- .../mdbci/templates/default.json.template | 3 ++- .../mdbci/templates/nogalera.json.template | 3 ++- .../mdbci/templates/performance.json.template | 3 ++- .../mdbci/templates/twomaxscales.json.template | 6 ++++-- 8 files changed, 17 insertions(+), 21 deletions(-) diff --git a/maxscale-system-test/mdbci/create_config.sh b/maxscale-system-test/mdbci/create_config.sh index 14cbb3f42..1e2795486 100755 --- a/maxscale-system-test/mdbci/create_config.sh +++ b/maxscale-system-test/mdbci/create_config.sh @@ -7,12 +7,6 @@ export script_dir="$(dirname $(readlink -f $0))" . ${script_dir}/set_run_test_variables.sh -${mdbci_dir}/repository-config/generate_all.sh repo.d -${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d - - -export repo_dir=$dir/repo.d/ - export provider=`${mdbci_dir}/mdbci show provider $box --silent 2> /dev/null` export backend_box=${backend_box:-"centos_7_"$provider} @@ -33,7 +27,7 @@ fi $(<${script_dir}/templates/${template}.json.template) " 2> /dev/null > ${MDBCI_VM_PATH}/${name}.json -${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json --repo-dir ${repo_dir} generate $name +${mdbci_dir}/mdbci --override --template ${MDBCI_VM_PATH}/${name}.json generate $name mkdir ${MDBCI_VM_PATH}/$name/cnf cp -r ${script_dir}/cnf/* ${MDBCI_VM_PATH}/$name/cnf/ diff --git a/maxscale-system-test/mdbci/run_test_snapshot.sh b/maxscale-system-test/mdbci/run_test_snapshot.sh index f0e99baef..a3e6c643d 100755 --- a/maxscale-system-test/mdbci/run_test_snapshot.sh +++ b/maxscale-system-test/mdbci/run_test_snapshot.sh @@ -43,8 +43,6 @@ done touch ${snapshot_lock_file} echo $JOB_NAME-$BUILD_NUMBER >> ${snapshot_lock_file} -export repo_dir=$dir/repo.d/ - ${mdbci_dir}/mdbci snapshot revert --path-to-nodes $name --snapshot-name $snapshot_name if [ $? != 0 ]; then @@ -60,14 +58,11 @@ fi . ${script_dir}/set_env.sh "$name" -${mdbci_dir}/repository-config/maxscale-ci.sh $target repo.d - - ${mdbci_dir}/mdbci sudo --command 'yum remove maxscale -y' $name/maxscale ${mdbci_dir}/mdbci sudo --command 'yum clean all' $name/maxscale -${mdbci_dir}/mdbci setup_repo --product maxscale $name/maxscale --repo-dir $repo_dir -${mdbci_dir}/mdbci install_product --product maxscale $name/maxscale --repo-dir $repo_dir +${mdbci_dir}/mdbci setup_repo --product maxscale_ci --product-version ${target} $name/maxscale +${mdbci_dir}/mdbci install_product --product maxscale_ci $name/maxscale checkExitStatus $? "Error installing Maxscale" $snapshot_lock_file diff --git a/maxscale-system-test/mdbci/templates/big.json.template b/maxscale-system-test/mdbci/templates/big.json.template index 56c0330ee..eb7c36901 100644 --- a/maxscale-system-test/mdbci/templates/big.json.template +++ b/maxscale-system-test/mdbci/templates/big.json.template @@ -145,7 +145,8 @@ "hostname" : "maxscale", "box" : "centos_7_aws_large", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/big15.json.template b/maxscale-system-test/mdbci/templates/big15.json.template index 1297ea96a..0fe08cf4d 100644 --- a/maxscale-system-test/mdbci/templates/big15.json.template +++ b/maxscale-system-test/mdbci/templates/big15.json.template @@ -222,7 +222,8 @@ "hostname" : "maxscale", "box" : "centos_7_aws_large", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/default.json.template b/maxscale-system-test/mdbci/templates/default.json.template index 2376e46a7..1523eb6c2 100644 --- a/maxscale-system-test/mdbci/templates/default.json.template +++ b/maxscale-system-test/mdbci/templates/default.json.template @@ -110,7 +110,8 @@ "box" : "${box}", "memory_size" : "${vm_memory}", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/nogalera.json.template b/maxscale-system-test/mdbci/templates/nogalera.json.template index 31f03af0b..14b654a61 100644 --- a/maxscale-system-test/mdbci/templates/nogalera.json.template +++ b/maxscale-system-test/mdbci/templates/nogalera.json.template @@ -58,7 +58,8 @@ "box" : "${box}", "memory_size" : "${vm_memory}", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/performance.json.template b/maxscale-system-test/mdbci/templates/performance.json.template index a767f9fc2..8d5652cbd 100644 --- a/maxscale-system-test/mdbci/templates/performance.json.template +++ b/maxscale-system-test/mdbci/templates/performance.json.template @@ -60,7 +60,8 @@ "box" : "###box###", "memory_size" : "2048", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } diff --git a/maxscale-system-test/mdbci/templates/twomaxscales.json.template b/maxscale-system-test/mdbci/templates/twomaxscales.json.template index a2c5b2258..a9ddc64f2 100644 --- a/maxscale-system-test/mdbci/templates/twomaxscales.json.template +++ b/maxscale-system-test/mdbci/templates/twomaxscales.json.template @@ -58,7 +58,8 @@ "box" : "${box}", "memory_size" : "${vm_memory}", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } }, @@ -69,7 +70,8 @@ "box" : "${box}", "memory_size" : "${vm_memory}", "product" : { - "name": "maxscale" + "name" : "maxscale_ci", + "version" : "${target}" } } From 5612896b80f82fecbc29e9002f7c20eacf23a07e Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Fri, 27 Jul 2018 14:24:58 +0300 Subject: [PATCH 6/6] regenerate repo.d only for current target --- BUILD/mdbci/copy_repos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/mdbci/copy_repos.sh b/BUILD/mdbci/copy_repos.sh index 3c6699d9d..26fb51ab6 100755 --- a/BUILD/mdbci/copy_repos.sh +++ b/BUILD/mdbci/copy_repos.sh @@ -39,4 +39,4 @@ $(<${script_dir}/templates/repository-config/deb.json.template) fi cd $dir -${mdbci_dir}/mdbci generate-product-repositories --product maxscale_ci +${mdbci_dir}/mdbci generate-product-repositories --product maxscale_ci --product-version $target