Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions ceph-pr-api/build/api
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
#!/bin/bash -e
cd src/pybind/mgr/dashboard
timeout 7200 ./run-backend-api-tests.sh

NPMCACHE=${HOME}/npmcache
export NPMCACHE # used by bwc function (silence shellcheck warning)
CB_SCRIPT_DIR=../../scripts
INNER_SCRIPT_DIR=build.scripts

# this script needs to be run inside the build image rather than
# on the build host. So create an intermediate location for scripts
# that bootstrap the test env than can be executed by a bwc custom
# command.
mkdir -p "${INNER_SCRIPT_DIR}"
# XXX: It can't find the other script??
cat > "${INNER_SCRIPT_DIR}/install-backend-api-test-deps.sh" <<EOF
#!/bin/bash
set -ex
if grep -q debian /etc/*-release; then
apt-get install -y python3-scipy python3-routes
elif grep -q rhel /etc/*-release; then
yum install -y scipy python-routes python3-routes
fi
EOF
chmod +x "${INNER_SCRIPT_DIR}/install-backend-api-test-deps.sh"

# TODO: either we have this hack or we update the dashboard script
# and the things it calss to avoid a bunch of hardcoded sudo calls.
# For now, this is the easier choice.
cat > "${INNER_SCRIPT_DIR}/install-fake-sudo.sh" <<EOF
#!/bin/sh
set -x
echo '#!/bin/sh' > /usr/local/bin/sudo
echo 'exec "\$@"' >> /usr/local/bin/sudo
chmod +x /usr/local/bin/sudo
EOF
chmod +x "${INNER_SCRIPT_DIR}/install-fake-sudo.sh"

bwc 2 -e custom -- \
"./${INNER_SCRIPT_DIR}/install-backend-api-test-deps.sh" \
'&&' "./${INNER_SCRIPT_DIR}/install-fake-sudo.sh" \
'&&' sudo ls \
'&&' cd src/pybind/mgr/dashboard \
'&&' ./run-backend-api-tests.sh
22 changes: 15 additions & 7 deletions ceph-pr-api/build/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ if [[ "$DOCS_ONLY" = true || "$CONTAINER_ONLY" = true || "$GHA_ONLY" == true ]];
exit 0
fi

n_build_jobs=$(get_nr_build_jobs)
n_test_jobs=$(($(nproc) / 4))
export CHECK_MAKEOPTS="-j${n_test_jobs} -N -Q"
export BUILD_MAKEOPTS="-j${n_build_jobs}"
export FOR_MAKE_CHECK=1
timeout 2h ./src/script/run-make.sh \
--cmake-args '-DWITH_TESTS=OFF -DENABLE_GIT_VERSION=OFF'
NPROC=$(nproc)
NPMCACHE=${HOME}/npmcache
export NPMCACHE # used by bwc function (silence shellcheck warning)
cat >.env <<EOF
NPROC=${NPROC}
MAX_PARALLEL_JOBS=${NPROC}
JENKINS_HOME=${JENKINS_HOME}
REWRITE_COVERAGE_ROOTDIR=${PWD}/src/pybind/mgr/dashboard/frontend
CONFIGURE_ARGS=-DWITH_TESTS=OFF
EOF

bwc_login
bwc_populate_npm_cache
bwc 4 -e build
npm_cache_info
sleep 5
ps -ef | grep ceph || true
2 changes: 1 addition & 1 deletion ceph-pr-api/config/definitions/ceph-pr-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
- shell:
!include-raw-verbatim:
- ../../../scripts/build_utils.sh
- ../../../scripts/bwc.sh
- ../../build/build
- ../../../scripts/dashboard/install-backend-api-test-deps.sh
- ../../build/api

# This job seems to get aborted more often than others. Multiple times in the past week,
Expand Down