github.com/cloudberrydb/gpbackup@v1.0.3-0.20240118031043-5410fd45eed6/ci/scripts/all-tests.bash (about) 1 #!/bin/bash 2 3 set -ex 4 5 # setup cluster and install gpbackup tools using gppkg 6 ccp_src/scripts/setup_ssh_to_cluster.sh 7 out=$(ssh -t cdw 'source env.sh && psql postgres -c "select version();"') 8 TEST_GPDB_VERSION=$(echo ${out} | sed -n 's/.*Greenplum Database \([0-9].[0-9]\+.[0-9]\+\).*/\1/p') 9 GPDB_VERSION=$(echo ${TEST_GPDB_VERSION} | head -c 1) 10 mkdir -p /tmp/untarred 11 tar -xzf gppkgs/gpbackup-gppkgs.tar.gz -C /tmp/untarred 12 scp /tmp/untarred/gpbackup_tools*gp${GPDB_VERSION}*RHEL*.gppkg cdw:/home/gpadmin 13 ssh -t cdw "source env.sh; gppkg -q gpbackup*gp*.gppkg | grep 'is installed' || gppkg -i gpbackup_tools*.gppkg" 14 15 # place correct tarballs in gpbackup dir for consumption 16 if [[ -f "bin_gpbackup_1.0.0_and_1.7.1/gpbackup_bins_1.0.0_and_1.7.1.tar.gz" ]] && \ 17 [[ "${GPBACKUP_VERSION}" != "" ]] ; then 18 tar -xzf bin_gpbackup_1.0.0_and_1.7.1/gpbackup_bins_1.0.0_and_1.7.1.tar.gz -C /tmp/ 19 scp -r /tmp/${GPBACKUP_VERSION} cdw:/tmp 20 fi 21 22 cat <<SCRIPT > /tmp/run_tests.bash 23 #!/bin/bash 24 25 set -ex 26 source env.sh 27 if [[ -f /opt/gcc_env.sh ]]; then 28 source /opt/gcc_env.sh 29 fi 30 cd \${GOPATH}/src/github.com/cloudberrydb/gpbackup 31 export OLD_BACKUP_VERSION="${GPBACKUP_VERSION}" 32 33 # Set the GPDB version to use for the unit tests 34 export TEST_GPDB_VERSION=${TEST_GPDB_VERSION} 35 36 make unit integration 37 38 # NOTE: This is a temporary hotfix intended to skip these tests when running on CCP cluster 39 # because the backup artifact that these tests are using only works on local clusters. 40 sed -i 's|\tIt\(.*\)\(--on-error-continue\)|\tPIt\1\2|' end_to_end/end_to_end_suite_test.go 41 42 if [ -z "\${OLD_BACKUP_VERSION}" ] ; then 43 make end_to_end 44 else 45 make install helper_path=/tmp/\${OLD_BACKUP_VERSION}/gpbackup_helper 46 ginkgo -r -randomizeSuites -slowSpecThreshold=10 -noisySkippings=false -randomizeAllSpecs end_to_end -- --custom_backup_dir "/tmp" 2>&1 47 fi 48 SCRIPT 49 50 chmod +x /tmp/run_tests.bash 51 scp /tmp/run_tests.bash cdw:/home/gpadmin/run_tests.bash 52 ssh -t cdw "/home/gpadmin/run_tests.bash"