From daab30a9874565de7c703fb684376c1b21cc2074 Mon Sep 17 00:00:00 2001 From: "aleksei.bukhalov" Date: Mon, 30 Jun 2025 18:06:19 +0200 Subject: [PATCH] chore(ci) MCOL-6071 execute unittests during build step in bootstrap_mcs.sh --- .drone.jsonnet | 48 ++---------------------------------------- build/bootstrap_mcs.sh | 9 +++++--- 2 files changed, 8 insertions(+), 49 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 334237e3a..a8d8ffb6e 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -86,32 +86,6 @@ local upgrade_test_lists = { }, }; -local gcc_version = "11"; - -local rockylinux8_deps = "dnf install -y 'dnf-command(config-manager)' " + - "&& dnf config-manager --set-enabled powertools " + - "&& dnf install -y gcc-toolset-" + gcc_version + " libarchive cmake " + - "&& . /opt/rh/gcc-toolset-" + gcc_version + "/enable "; - -local rockylinux9_deps = "dnf install -y 'dnf-command(config-manager)' " + - "&& dnf config-manager --set-enabled crb " + - "&& dnf install -y gcc gcc-c++"; - -local rockylinux_common_deps = " && dnf install -y git lz4 lz4-devel cppunit-devel cmake3 boost-devel snappy-devel pcre2-devel"; - -local deb_deps = rewrite_ubuntu_mirror + "apt-get clean && apt-get update && apt-get install --yes git libboost-all-dev libcppunit-dev libsnappy-dev cmake libpcre2-dev"; - -local testPreparation(platform) = - local platform_map = { - "rockylinux:8": rockylinux8_deps + rockylinux_common_deps, - "rockylinux:9": rockylinux9_deps + rockylinux_common_deps, - "debian:12": deb_deps, - "ubuntu:20.04": deb_deps, - "ubuntu:22.04": deb_deps, - "ubuntu:24.04": deb_deps, - }; - platform_map[platform]; - local make_clickable_link(link) = "echo -e '\\e]8;;" + link + "\\e\\\\" + link + "\\e]8;;\\e\\\\'"; local echo_running_on = ["echo running on ${DRONE_STAGE_MACHINE}", make_clickable_link("https://us-east-1.console.aws.amazon.com/ec2/home?region=us-east-1#Instances:search=:${DRONE_STAGE_MACHINE};v=3;$case=tags:true%5C,client:false;$regex=tags:false%5C,client:false;sort=desc:launchTime")]; @@ -502,7 +476,7 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise", }, commands: echo_running_on + [ - "echo $$SERVER_REF", + "echo $$SERVER_REF", "echo $$SERVER_REMOTE", "mkdir -p /mdb/" + builddir + " && cd /mdb/" + builddir, 'git config --global url."https://github.com/".insteadOf git@github.com:', @@ -537,7 +511,6 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise", commands: [ "mkdir /mdb/" + builddir + "/" + result, ] - + get_sccache + customEnvCommands(customBuildEnvCommandsMapKey, builddir) + [ 'bash -c "set -o pipefail && bash /mdb/' + builddir + "/storage/columnstore/columnstore/build/bootstrap_mcs.sh " + @@ -574,26 +547,9 @@ local Pipeline(branch, platform, event, arch="amd64", server="10.6-enterprise", "bash /mdb/" + builddir + "/storage/columnstore/columnstore/build/createrepo.sh --result " + result, ], }, - { - name: "unittests", - depends_on: ["createrepo"], - image: img, - volumes: [pipeline._volumes.mdb], - environment: { - DEBIAN_FRONTEND: "noninteractive", - }, - commands: [ - "cd /mdb/" + builddir, - testPreparation(platform), - - if (platform == "rockylinux:8" || platform == "rockylinux:9") - then "ctest3 -R columnstore: -j $(nproc) --output-on-failure" - else "cd builddir; ctest -R columnstore: -j $(nproc) --output-on-failure", - ], - }, { name: "pkg", - depends_on: ["unittests"], + depends_on: ["createrepo"], image: "alpine/git:2.49.0", when: { status: ["success", "failure"], diff --git a/build/bootstrap_mcs.sh b/build/bootstrap_mcs.sh index 368b39501..ebb503127 100755 --- a/build/bootstrap_mcs.sh +++ b/build/bootstrap_mcs.sh @@ -11,7 +11,6 @@ export CLICOLOR_FORCE=1 #cmake output INSTALL_PREFIX="/usr/" DATA_DIR="/var/lib/mysql/data" CMAKE_BIN_NAME=cmake -CTEST_BIN_NAME=ctest RPM_CONFIG_DIR="/etc/my.cnf.d" DEB_CONFIG_DIR="/etc/mysql/mariadb.conf.d" @@ -77,9 +76,12 @@ if [[ ! " ${DISTRO_OPTIONS[*]} " =~ " ${OS} " ]]; then detect_distro fi -pkg_format="deb" if [[ "$OS" == *"rocky"* ]]; then pkg_format="rpm" + CTEST_BIN_NAME=:"ctest3" +else + pkg_format="deb" + CTEST_BIN_NAME="ctest" fi install_sccache() { @@ -585,7 +587,7 @@ run_unit_tests() { message "Running unittests" cd $MARIA_BUILD_PATH - ${CTEST_BIN_NAME} . -R columnstore: -j $(nproc) --progress --output-on-failure + ${CTEST_BIN_NAME} . -R columnstore: -j $(nproc) --output-on-failure cd - >/dev/null } @@ -778,6 +780,7 @@ if [[ $BUILD_PACKAGES = true ]]; then modify_packaging build_package message_splitted "PACKAGES BUILD FINISHED" + run_unit_tests exit 0 fi