From 6845db0768ea8198bc0860581a7c682b02d28f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20L=C3=BCdtke?= Date: Fri, 29 Jan 2021 11:14:13 +0100 Subject: [PATCH] Limit Travis CI tests to minimum coverage --- .github/workflows/main.yml | 2 +- .travis.yml | 81 ++++--------------------------------- industrial_ci/_wrap_test.sh | 35 ---------------- 3 files changed, 9 insertions(+), 109 deletions(-) delete mode 100755 industrial_ci/_wrap_test.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77ebe05a1..af1c95546 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v1 - uses: docker://koalaman/shellcheck-alpine with: - args: /bin/sh -c "shellcheck -x *.sh industrial_ci/scripts/*_ci industrial_ci/src/*.sh industrial_ci/src/*/*.sh industrial_ci/*.sh" + args: /bin/sh -c "shellcheck -x *.sh industrial_ci/scripts/*_ci industrial_ci/src/*.sh industrial_ci/src/*/*.sh" industrial_ci: strategy: matrix: diff --git a/.travis.yml b/.travis.yml index 959b3a37e..3d141fd19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ services: - docker -# Force travis to use its minimal image with default Python settings + language: generic git: @@ -13,81 +13,16 @@ git: env: matrix: - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' VERBOSE_OUTPUT='true' CATKIN_LINT=true AFTER_SCRIPT='[ "$(command -v catkin_lint)" = /usr/local/bin/catkin_lint ]' - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' CATKIN_LINT=true ADDITIONAL_DEBS='python-catkin-lint' AFTER_SCRIPT='[ "$(command -v catkin_lint)" = /usr/bin/catkin_lint ]' - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' CMAKE_ARGS="-DFAIL_CMAKE=true" EXPECT_EXIT_CODE=1 - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' CATKIN_LINT=pedantic EXPECT_EXIT_CODE=1 - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' ROSDEP_SKIP_KEYS="rospy_tutorials rostest" EXPECT_EXIT_CODE=1 - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/testpkg_broken_install' EXPECT_EXIT_CODE=1 - - ROS_DISTRO=melodic NOT_TEST_BUILD='true' _GUARD_INTERVAL=10 - - ROS_DISTRO=kinetic NOT_TEST_INSTALL='true' BEFORE_INIT='test -z "${CXX+x}"' # test that CXX is not set - - ROS_DISTRO=kinetic NOT_TEST_INSTALL='true' CXX=/usr/bin/gcc BEFORE_INIT='test -z "${CXX+x}"' EXPECT_EXIT_CODE=1 # test the CXX test - - ROS_DISTRO=kinetic NOT_TEST_BUILD='true' NOT_TEST_INSTALL='true' # This may not make much sense. Only for testing purpose. - - ROS_DISTRO=kinetic NOT_TEST_BUILD='true' NOT_TEST_INSTALL='true' POST_PROCESS='I_am_supposed_to_fail' - - ROS_DISTRO=kinetic CATKIN_PARALLEL_JOBS='-p1' ROS_PARALLEL_JOBS='-j1' # Intend build on low-power platform - # - env: ROS_DISTRO=indigo PRERELEASE=true ## Comment out because this is meaningless for always failing without prerelease testable contents in industrial_ci. - - ROS_DISTRO=melodic PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=1 - - ROS_DISTRO=melodic PRERELEASE=true TARGET_WORKSPACE='industrial_ci/mockups/failing_test' PRERELEASE_REPONAME="failing_test" EXPECT_EXIT_CODE=1 - - ROS_DISTRO=kinetic PRERELEASE=true PRERELEASE_REPONAME=industrial_ci - - ROS_DISTRO=kinetic UPSTREAM_WORKSPACE=debian AFTER_SCRIPT='ccache 2> /dev/null && exit 1; [ "$?" = "127" ]' - # Using default file name for ROSINSTALL_FILENAME, test CCACHE, verify cache was filled - - ROS_DISTRO=kinetic UPSTREAM_WORKSPACE=file CCACHE_DIR=$HOME/.ccache AFTER_SCRIPT='num=($(ccache -s | grep "files in cache")) && (( num[-1] > 0 ))' - - ROS_DISTRO=indigo UPSTREAM_WORKSPACE=file USE_DEB=true EXPECT_EXIT_CODE=1 # Expected to fail. See https://github.com/ros-industrial/industrial_ci/pull/74 - - ROS_DISTRO=kinetic UPSTREAM_WORKSPACE=https://raw.githubusercontent.com/ros-industrial/industrial_ci/master/.travis.rosinstall - - ROS_DISTRO=indigo ADDITIONAL_DEBS="ros-indigo-opencv3" VERBOSE_OUTPUT='false' - - ROS_DISTRO=indigo ADDITIONAL_DEBS="ros-hydro-opencv3" DEBUG_BASH='true' EXPECT_EXIT_CODE=100 # This should fail (trying from a wrong distro). - - ROS_DISTRO=kinetic UPSTREAM_WORKSPACE=file ROSINSTALL_FILENAME=.ci.rosinstall # Testing arbitrary file name without ROS_DISTRO suffix. As of 6/3/2016 this fails due to https://github.com/ros-industrial/industrial_core/pull/144#issuecomment-223186764 - - ROS_DISTRO=kinetic UPSTREAM_WORKSPACE=file ROSINSTALL_FILENAME=.i.do.not.exist EXPECT_EXIT_CODE=1 - - DOCKER_IMAGE="ros:kinetic-ros-base" ROS_REPO=ros NOT_TEST_BUILD='true' DEBUG_BASH='true' VERBOSE_OUTPUT='false' DOCKER_COMMIT="img_temp" POST_PROCESS='eval docker image inspect $DOCKER_COMMIT --format="$DOCKER_COMMIT:\ \"{{.Size}}\" bytes"' - - ROS_DISTRO=lunar ROS_REPO=ros-shadow-fixed TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' - - ROS_DISTRO=melodic AFTER_SCRIPT='grep -q ID=ubuntu /etc/os-release && grep -q VERSION_CODENAME=bionic /etc/os-release' - - ROS_DISTRO=melodic BEFORE_INIT='grep -q ID=debian /etc/os-release && grep -q VERSION_ID=\"9\" /etc/os-release' EXPECT_EXIT_CODE=1 - - ROS_DISTRO=melodic OS_NAME=debian OS_CODE_NAME=stretch AFTER_SCRIPT='grep -q ID=debian /etc/os-release && grep -q VERSION_ID=\"9\" /etc/os-release' - - ROS_DISTRO=melodic OS_NAME=debian EXPECT_EXIT_CODE=1 - - ROS_DISTRO=melodic OS_NAME=debian OS_CODE_NAME=bionic EXPECT_EXIT_CODE=1 - - ROS_DISTRO=melodic ROS_REPO=ros BUILDER=colcon AFTER_SCRIPT='rosenv && [ "$CMAKE_PREFIX_PATH" = "/root/target_ws/install/industrial_ci:/opt/ros/melodic" ]' - - ROS_DISTRO=noetic TARGET_WORKSPACE='industrial_ci/mockups/industrial_ci_testpkg' + - ROS_DISTRO=noetic - ROS_DISTRO=noetic PRERELEASE=true - - ROS_DISTRO=foxy - - ROS_DISTRO=rolling - - # External repositories - - ROS_DISTRO=kinetic _EXTERNAL_REPO='github:ros-industrial/industrial_core@kinetic-devel' - - ROS_DISTRO=kinetic _EXTERNAL_REPO='gh:ros-industrial/motoman_experimental#kinetic-devel' UPSTREAM_WORKSPACE='.travis.rosinstall -ros-industrial/industrial_experimental/IRC_v2' ROS_REPO=ros - - ROS_DISTRO=kinetic _EXTERNAL_REPO='github:ipa320/cob_calibration_data#indigo_dev' ROS_REPO=ros UPSTREAM_WORKSPACE=file AFTER_SCRIPT='rosenv sh .travis.xacro_test.sh' - - ROS_DISTRO=indigo _EXTERNAL_REPO='github:ros/actionlib#38ce66e2ae2ec9c19cf12ab22d57a8134a9285be' ROS_REPO=ros ABICHECK_URL=url ABICHECK_MERGE=true # actual URL will not be used in the case - - ROS_DISTRO=kinetic _EXTERNAL_REPO='github:ros-industrial/ros_canopen#0.7.5' ROS_REPO=ros ABICHECK_URL='github:ros-industrial/ros_canopen#0.7.1' ABICHECK_MERGE=false EXPECT_EXIT_CODE=1 - - ROS_DISTRO=kinetic _EXTERNAL_REPO='github:ros-industrial/ros_canopen#0.7.6' ABICHECK_URL='github:ros-industrial/ros_canopen#0.7.5' ABICHECK_MERGE=false - - ROS_DISTRO=bouncy _EXTERNAL_REPO='github:ros2/joystick_drivers#bouncy' - - ROS_DISTRO=crystal _EXTERNAL_REPO='github:ros-controls/control_msgs#crystal-devel' - - ROS_DISTRO=dashing _EXTERNAL_REPO='github:ros-controls/control_msgs#crystal-devel' ROS_REPO=ros - - ROS_DISTRO=dashing _EXTERNAL_REPO='github:ros-controls/control_msgs#crystal-devel' PRERELEASE=true - - ROS_DISTRO=eloquent _EXTERNAL_REPO='github:ros-controls/control_msgs#crystal-devel' - - # Format tests - - ROS_DISTRO=indigo TARGET_WORKSPACE='industrial_ci/mockups/format_tests/cpp/LLVM' CLANG_FORMAT_CHECK='LLVM' CLANG_FORMAT_VERSION=3.8 - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/format_tests/cpp/LLVM' CLANG_FORMAT_CHECK='LLVM' - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/format_tests/cpp/WebKit' CLANG_FORMAT_CHECK='LLVM' EXPECT_EXIT_CODE=1 - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/format_tests/cpp/WebKit' CLANG_FORMAT_CHECK='file' - - ROS_DISTRO=kinetic TARGET_WORKSPACE='industrial_ci/mockups/format_tests/cpp/LLVM' CLANG_FORMAT_CHECK='WebKit' EXPECT_EXIT_CODE=1 - - # Tidy - - ROS_DISTRO=melodic TARGET_WORKSPACE='industrial_ci/mockups/test_clang_tidy' CLANG_TIDY=pedantic - - ROS_DISTRO=melodic TARGET_WORKSPACE='industrial_ci/mockups/test_clang_tidy' CLANG_TIDY=pedantic CLANG_TIDY_ARGS="-checks=modernize-use-nullptr" EXPECT_EXIT_CODE=1 matrix: - allow_failures: - - env: ROS_DISTRO=kinetic NOT_TEST_BUILD='true' NOT_TEST_INSTALL='true' POST_PROCESS='I_am_supposed_to_fail' include: - - install: - - docker run --rm --privileged multiarch/qemu-user-static --reset --credential yes --persistent yes - env: - - DOCKER_IMAGE='arm32v7/ros:melodic-ros-core' BEFORE_INIT='[[ $(uname -p) == armv7l ]] && exit 42' EXPECT_EXIT_CODE=42 - name: "Test on ARM" - - script: - - industrial_ci/scripts/run_travis - - industrial_ci/scripts/run_travis 1 - name: run_travis + - env: + - ROS_DISTRO=noetic ISOLATION=shell + os: linux + dist: focal + language: cpp script: - - industrial_ci/_wrap_test.sh # this script is only for internal use + - ./travis.sh diff --git a/industrial_ci/_wrap_test.sh b/industrial_ci/_wrap_test.sh deleted file mode 100755 index 53964d58c..000000000 --- a/industrial_ci/_wrap_test.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2017, Mathias Lüdtke -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This is the internal entrypoint for industrial_ci testing - -set -e # exit script on errors - -if [ -n "$_EXTERNAL_REPO" ]; then - export TRAVIS_BUILD_DIR; TRAVIS_BUILD_DIR=$(mktemp -d) - source ./industrial_ci/src/workspace.sh - IFS=" " read -r -a parts <<< "$(ici_parse_repository_url "$_EXTERNAL_REPO")" # name, type, url, version - echo "Cloning '${parts[2]}'...'" - git clone -q "${parts[2]}" "$TRAVIS_BUILD_DIR" - git -C "$TRAVIS_BUILD_DIR" checkout "${parts[3]}" - - urlbasename=${parts[2]##*/} - urldirname=${parts[2]%/$urlbasename} - export TRAVIS_REPO_SLUG="${urldirname##*/}/${urlbasename%.git}" -fi - -./travis.sh