Skip to content

Commit

Permalink
Merge branch 'master' into jrivero/fix_ratt
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero authored Nov 5, 2024
2 parents 9423787 + 502bfff commit ef610de
Show file tree
Hide file tree
Showing 40 changed files with 963 additions and 222 deletions.
68 changes: 62 additions & 6 deletions check_releasepy.bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
#!/bin/bash -e

test_dir=$(mktemp -d)
mkdir -p ${test_dir}/{focal,jammy,ubuntu}/debian
export _RELEASEPY_TEST_RELEASE_REPO=${test_dir}
export _RELEASEPY_DEBUG=1
test_dir=$(mktemp -d)
export _RELEASEPY_TEST_RELEASE_REPO="${test_dir}/test-release"
mkdir -p ${_RELEASEPY_TEST_RELEASE_REPO}/{focal,jammy,ubuntu}/debian
export _RELEASEPY_TEST_SOURCE_REPO="${test_dir}/src"
mkdir -p ${_RELEASEPY_TEST_SOURCE_REPO}
# Fake packages.xml to make the vendor package script happy
cat > "${_RELEASEPY_TEST_SOURCE_REPO}/package.xml" <<-EOF
<?xml version="1.0"?>
<package format="2">
<name>gz-foo</name>
<version>0.0.0</version>
<description>test</description>
<maintainer email="[email protected]">Testing maintainer</maintainer>
<license>Foo License</license>
</package>
EOF

exec_releasepy_test()
{
Expand All @@ -12,7 +25,7 @@ exec_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
gz-foo 1.2.3 token ${test_params}""
gz-foo 1.2.3 token ${test_params}
}

exec_ignition_releasepy_test()
Expand All @@ -22,7 +35,7 @@ exec_ignition_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
ign-foo 1.2.3 token ${test_params}""
ign-foo 1.2.3 token ${test_params}
}

exec_ignition_gazebo_releasepy_test()
Expand All @@ -32,7 +45,18 @@ exec_ignition_gazebo_releasepy_test()
./release.py \
--dry-run \
--no-sanity-checks \
ign-gazebo 1.2.3 token ${test_params}""
ign-gazebo 1.2.3 token ${test_params}
}

exec_releasepy_with_real_gz()
{
gz_pkg=${1} major_version=${2}
./release.py \
--dry-run \
--no-sanity-checks \
--source-repo-uri http://github.com/gazebosim/gz-common \
--source-repo-existing-ref http://github.com/gazebosim/gz-common/foo-tag \
"${gz_pkg}" "${major_version}.x.y" token
}

expect_job_run()
Expand Down Expand Up @@ -73,35 +97,58 @@ expect_param()
echo "${param} not found in test output"
exit 1
fi
}

expect_vendor_repo()
{
output="${1}" repo="${2}"

if ! grep -q "Github ${repo}" <<< "${output}"; then
echo "${repo} not found in test output"
exit 1
fi
}

expect_no_vendor()
{
output="${1}"

if grep -q 'in ROS 2' <<< "${output}"; then
echo "ROS 2 string found in output"
exit 1
fi
}

source_repo_uri_test=$(exec_releasepy_test "--source-repo-uri https://github.com/gazebosim/gz-foo.git")
expect_job_run "${source_repo_uri_test}" "gz-foo-source"
expect_job_not_run "${source_repo_uri_test}" "gz-foo-debbuilder"
expect_number_of_jobs "${source_repo_uri_test}" "1"
expect_param "${source_repo_uri_test}" "SOURCE_REPO_URI=https%3A%2F%2Fgithub.com%2Fgazebosim%2Fgz-foo.git"
expect_no_vendor "${source_repo_uri_test}" # non existing package

source_tarball_uri_test=$(exec_releasepy_test "--source-tarball-uri https://gazebosim/gz-foo-1.2.3.tar.gz")
expect_job_run "${source_tarball_uri_test}" "gz-foo-debbuilder"
expect_job_run "${source_tarball_uri_test}" "generic-release-homebrew_pull_request_updater"
expect_job_not_run "${source_tarball_uri_test}" "gz-foo-source"
expect_number_of_jobs "${source_tarball_uri_test}" "7"
expect_param "${source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fgz-foo-1.2.3.tar.gz"
expect_no_vendor "${source_tarball_uri_test}"

nightly_test=$(exec_releasepy_test "--nightly-src-branch my-nightly-branch3 --upload-to-repo nightly")
expect_job_run "${nightly_test}" "gz-foo-debbuilder"
expect_job_not_run "${nightly_test}" "generic-release-homebrew_pull_request_updater"
expect_job_not_run "${nightly_test}" "gz-foo-source"
expect_number_of_jobs "${nightly_test}" "2"
expect_param "${nightly_test}" "SOURCE_TARBALL_URI=my-nightly-branch3"
expect_no_vendor "${nightly_test}"

bump_linux_test=$(exec_releasepy_test "--source-tarball-uri https://gazebosim/gz-foo-1.2.3.tar.gz --only-bump-revision-linux -r 2")
expect_job_run "${bump_linux_test}" "gz-foo-debbuilder"
expect_job_not_run "${bump_linux_test}" "generic-release-homebrew_pull_request_updater"
expect_job_not_run "${bump_linux_test}" "gz-foo-source"
expect_number_of_jobs "${bump_linux_test}" "6"
expect_param "${bump_linux_test}" "RELEASE_VERSION=2"
expect_no_vendor "${bump_linux_test}"

ignition_test=$(exec_ignition_releasepy_test "--source-repo-uri https://github.com/gazebosim/gz-foo.git")
expect_job_run "${ignition_test}" "gz-foo-source"
Expand All @@ -128,3 +175,12 @@ expect_number_of_jobs "${ign_gazebo_source_tarball_uri_test}" "7"
expect_param "${ign_gazebo_source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fign-gazebo-1.2.3.tar.gz"
expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE=ign-gazebo"
expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE_ALIAS=ignition-gazebo"

ros_vendor_test=$(exec_releasepy_with_real_gz gz-fuel-tools 9)
expect_vendor_repo "${ros_vendor_test}" gazebo-release/gz_fuel_tools_vendor

ros_vendor_test=$(exec_releasepy_with_real_gz gz-cmake 2)
expect_no_vendor "${ros_vendor_test}"

ros_vendor_test=$(exec_releasepy_with_real_gz gz-ionic 3)
expect_no_vendor "${ros_vendor_test}"
6 changes: 2 additions & 4 deletions jenkins-scripts/docker/debian-ratt-builder.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ echo '# BEGIN SECTION: setup the testing enviroment'
# Define the name to be used in docker
export DOCKER_JOB_NAME="debian_ratt_builder"
. "${SCRIPT_DIR}/lib/boilerplate_prepare.sh"
. "${SCRIPT_DIR}/lib/_common_scripts.bash"
echo '# END SECTION'

cat > build.sh << DELIM
###################################################
# Make project-specific changes here
#
set -ex
$(generate_buildsh_header)
if ${USE_UNSTABLE}; then
TARGET_DISTRO='unstable'
Expand Down
4 changes: 2 additions & 2 deletions jenkins-scripts/docker/gz-source-generation.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ echo '# BEGIN SECTION: setup the testing enviroment'
# Define the name to be used in docker
export DOCKER_JOB_NAME="source_generation_job"
. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash
echo '# END SECTION'

cat > build.sh << DELIM
#!/bin/bash
set -ex
$(generate_buildsh_header)
PKG_DIR=\$WORKSPACE/pkgs
SOURCES_DIR=\$WORKSPACE/sources
Expand Down
6 changes: 5 additions & 1 deletion jenkins-scripts/docker/gz_rendering-compilation.bash
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ fi
export GPU_SUPPORT_NEEDED=true
export GZDEV_PROJECT_NAME="gz-rendering${GZ_RENDERING_MAJOR_VERSION}"

export BUILDING_EXTRA_CMAKE_PARAMS+=" -DSKIP_optix=true"
# set SKIP_optix=true for Harmonic and earlier
# not needed for ionic since https://github.com/gazebosim/gz-rendering/pull/1032
if [[ ${GZ_RENDERING_MAJOR_VERSION} -le 8 ]]; then
export BUILDING_EXTRA_CMAKE_PARAMS+=" -DSKIP_optix=true"
fi

. ${SCRIPT_DIR}/lib/generic-building-base.bash
13 changes: 13 additions & 0 deletions jenkins-scripts/docker/lib/_common_scripts.bash
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
export APT_INSTALL="sudo DEBIAN_FRONTEND=noninteractive apt-get install -y"

generate_buildsh_header()
{
SHELL_ON_ERRORS=${SHELL_ON_ERRORS:-false}
echo "#!/bin/bash"
echo "set -ex"
if ${SHELL_ON_ERRORS}; then
echo 'trap "/bin/bash" 0 INT QUIT ABRT PIPE TERM'
fi
if $GENERIC_ENABLE_TIMING; then
echo "source ${TIMING_DIR}/_time_lib.sh ${WORKSPACE}"
fi
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ fi
[[ -z $GENERIC_ENABLE_CPPCHECK ]] && GENERIC_ENABLE_CPPCHECK=true
[[ -z $GENERIC_ENABLE_TESTS ]] && GENERIC_ENABLE_TESTS=true

cat > build.sh << DELIM_HEADER
#!/bin/bash
set -ex
. ${SCRIPT_DIR}/lib/_common_scripts.bash

if $GENERIC_ENABLE_TIMING; then
source ${TIMING_DIR}/_time_lib.sh ${WORKSPACE}
fi
cat > build.sh << DELIM_HEADER
$(generate_buildsh_header)
DELIM_HEADER

# Process the source build of dependencies if needed
Expand Down
4 changes: 4 additions & 0 deletions jenkins-scripts/docker/lib/boilerplate_prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ source ${SCRIPT_DIR}/../lib/boilerplate_timing_prepare.sh
init_stopwatch TOTAL_TIME
init_stopwatch CREATE_TESTING_ENVIROMENT

# Enable shell on errors is designed to help debuging but never
# to be run on Jenkins.
SHELL_ON_ERRORS=${SHELL_ON_ERRORS:-false}

# Default values - Provide them is prefered
if [ -z ${DISTRO} ]; then
DISTRO=bionic
Expand Down
7 changes: 2 additions & 5 deletions jenkins-scripts/docker/lib/debbuild-backport.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ fi
export ENABLE_REAPER=false

. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash

cat > build.sh << DELIM
###################################################
# Make project-specific changes here
#
#!/usr/bin/env bash
set -ex
$(generate_buildsh_header)
cd $WORKSPACE/build
Expand Down
7 changes: 2 additions & 5 deletions jenkins-scripts/docker/lib/debbuild-base.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ fi
export ENABLE_REAPER=false

. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash
. ${SCRIPT_DIR}/lib/_gazebo_utils.sh

cat > build.sh << DELIM
###################################################
# Make project-specific changes here
#
#!/usr/bin/env bash
set -ex
$(generate_buildsh_header)
cd $WORKSPACE/build
Expand Down
7 changes: 2 additions & 5 deletions jenkins-scripts/docker/lib/debbuild-bloom-base.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@ export ENABLE_REAPER=false
PACKAGE_UNDERSCORE_NAME=${PACKAGE//-/_}

. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash
. ${SCRIPT_DIR}/lib/_gazebo_utils.sh

cat > build.sh << DELIM
###################################################
# Make project-specific changes here
#
#!/usr/bin/env bash
set -ex
$(generate_buildsh_header)
cd $WORKSPACE/build
Expand Down
7 changes: 2 additions & 5 deletions jenkins-scripts/docker/lib/debian-git-repo-base.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
export ENABLE_REAPER=false

. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash
. ${SCRIPT_DIR}/lib/_gazebo_utils.sh

# The git plugin leaves a repository copy with a detached HEAD
Expand All @@ -26,11 +27,7 @@ if [[ -z ${BRANCH} ]]; then
fi

cat > build.sh << DELIM
###################################################
# Make project-specific changes here
#
#!/usr/bin/env bash
set -ex
$(generate_buildsh_header)
if ${CLONE_NEEDED}; then
echo '# BEGIN SECTION: clone the git repo'
Expand Down
4 changes: 4 additions & 0 deletions jenkins-scripts/docker/lib/docker_generate_dockerfile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ if [[ -z ${OSRF_REPOS_TO_USE} ]]; then
fi
fi

# Enable shell on errors is designed to help debuging but never
# to be run on Jenkins.
SHELL_ON_ERRORS=${SHELL_ON_ERRORS:-false}

echo '# BEGIN SECTION: create the Dockerfile'
cat > Dockerfile << DELIM_DOCKER
#######################################################
Expand Down
9 changes: 4 additions & 5 deletions jenkins-scripts/docker/lib/gazebo_ros_pkgs-check-release.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export ENABLE_REAPER=false

DOCKER_JOB_NAME="gazebo_ros_pkgs_ci"
. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash
. ${SCRIPT_DIR}/lib/_gazebo_utils.sh

ROS_SETUP_PREINSTALL_HOOK="""
Expand All @@ -20,7 +21,8 @@ ${GAZEBO_MODEL_INSTALLATION}

if ${ROS2}; then
cat > build.sh << DELIM_CHECKOUT
set -ex
$(generate_buildsh_header)
source /opt/ros/${ROS_DISTRO}/setup.bash
TEST_TIMEOUT=90
Expand All @@ -36,10 +38,7 @@ fi
DELIM_CHECKOUT
else
cat > build.sh << DELIM_CHECKOUT
###################################################
# Make project-specific changes here
#
set -ex
$(generate_buildsh_header)
[[ -d ${WORKSPACE}/gazebo_ros_demos ]] && rm -fr ${WORKSPACE}/gazebo_ros_demos
git clone https://github.com/ros-simulation/gazebo_ros_demos ${WORKSPACE}/gazebo_ros_demos
Expand Down
8 changes: 2 additions & 6 deletions jenkins-scripts/docker/lib/generic-abi-base.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ echo '# BEGIN SECTION: setup the testing enviroment'
# Define the name to be used in docker
DOCKER_JOB_NAME="abi_job"
. ${SCRIPT_DIR}/lib/boilerplate_prepare.sh
. ${SCRIPT_DIR}/lib/_common_scripts.bash
echo '# END SECTION'

# Could be empty, just fine
Expand All @@ -44,12 +45,7 @@ if [[ "${NEED_C17_COMPILER}" == "true" ]]; then
fi

cat > build.sh << DELIM
#!/bin/bash
###################################################
# Make project-specific changes here
#
set -ex
$(generate_buildsh_header)
if [ `expr length "${ABI_JOB_PRECHECKER_HOOK} "` -gt 1 ]; then
echo '# BEGIN SECTION: running pre ABI hook'
Expand Down
7 changes: 1 addition & 6 deletions jenkins-scripts/docker/lib/generic-install-base.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ DOCKER_JOB_NAME="install_job"
echo '# END SECTION'

cat > build.sh << DELIM
#!/bin/bash
###################################################
# Make project-specific changes here
#
set -ex
$(generate_buildsh_header)
if [ `expr length "${INSTALL_JOB_PREINSTALL_HOOK} "` -gt 1 ]; then
echo '# BEGIN SECTION: running pre install hook'
Expand Down
8 changes: 3 additions & 5 deletions jenkins-scripts/docker/lib/gzdev-base-linux.bash
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
echo '# BEGIN SECTION: setup the testing enviroment'
export DOCKER_JOB_NAME="gzdev"
. "${SCRIPT_DIR}/lib/boilerplate_prepare.sh"
. "${SCRIPT_DIR}/lib/_common_scripts.bash"
. "${SCRIPT_DIR}/lib/_install_nvidia_docker.sh"
echo '# END SECTION'

. ${SCRIPT_DIR}/lib/_install_nvidia_docker.sh

cat > build.sh << DELIM
###################################################
#
set -ex
$(generate_buildsh_header)
export MAKE_JOBS=${MAKE_JOBS}
export DISPLAY=${DISPLAY}
Expand Down
2 changes: 1 addition & 1 deletion jenkins-scripts/dsl/_configs_/OSRFLinuxABIGitHub.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class OSRFLinuxABIGitHub

logRotator {
artifactNumToKeep(10)
numToKeep(200)
numToKeep(125)
}

concurrentBuild(true)
Expand Down
Loading

0 comments on commit ef610de

Please sign in to comment.