Remove distcheck and dist_install Kokoro tests (#10326)

These tests verify that various things can be built/installed/tested
using our published distribution archives, but starting with 22.0 we
will no longer be publishing those.
pull/10332/head
Adam Cozzette 3 years ago committed by GitHub
parent 1122a02024
commit c10963c571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 61
      kokoro/linux/bazel_distcheck/build.sh
  2. 9
      kokoro/linux/bazel_distcheck/common.cfg
  3. 5
      kokoro/linux/bazel_distcheck/continuous.cfg
  4. 5
      kokoro/linux/bazel_distcheck/presubmit.cfg
  5. 60
      kokoro/linux/cmake_distcheck/build.sh
  6. 5
      kokoro/linux/cmake_distcheck/continuous.cfg
  7. 5
      kokoro/linux/cmake_distcheck/presubmit.cfg
  8. 25
      kokoro/linux/cpp_distcheck/build.sh
  9. 5
      kokoro/linux/cpp_distcheck/continuous.cfg
  10. 5
      kokoro/linux/cpp_distcheck/presubmit.cfg
  11. 15
      kokoro/linux/dist_install/build.sh
  12. 5
      kokoro/linux/dist_install/continuous.cfg
  13. 5
      kokoro/linux/dist_install/presubmit.cfg
  14. 11
      kokoro/macos/cpp_distcheck/build.sh
  15. 5
      kokoro/macos/cpp_distcheck/continuous.cfg
  16. 5
      kokoro/macos/cpp_distcheck/presubmit.cfg
  17. 39
      tests.sh

@ -1,61 +0,0 @@
#!/bin/bash
#
# Build file to set up and run tests using bazel-build dist archive
#
# Note that the builds use WORKSPACE to fetch external sources, not
# git submodules.
set -eu
use_bazel.sh 5.0.0 || true
bazel version
# Change to repo root
cd $(dirname $0)/../../..
# Get kokoro scripts from repo root by default.
: ${SCRIPT_ROOT:=$(pwd)}
source ${SCRIPT_ROOT}/kokoro/common/pyenv.sh
# Build distribution archive
echo "============================================================"
echo -e "[[ $(date) ]] Building distribution archive...\n"
${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh build //pkg:dist_all_tar
DIST_ARCHIVE=$(readlink $(bazel info bazel-bin)/pkg/dist_all_tar.tar.gz)
bazel shutdown
# Extract the dist archive.
echo "============================================================"
echo -e "[[ $(date) ]] Extracting distribution archive...\n"
# Construct temp directory for running the dist build.
# If you want to run locally and keep the build dir, create a directory
# and pass it in the DIST_WORK_ROOT env var.
if [[ -z ${DIST_WORK_ROOT:-} ]]; then
: ${DIST_WORK_ROOT:=$(mktemp -d)}
function dist_cleanup() {
(( $BASH_SUBSHELL == 0 )) && rm -rf ${DIST_WORK_ROOT}
}
trap dist_cleanup EXIT
fi
DIST_WORKSPACE=${DIST_WORK_ROOT}/protobuf
mkdir -p ${DIST_WORKSPACE}
tar -C ${DIST_WORKSPACE} --strip-components=1 -axf bazel-bin/pkg/dist_all_tar.tar.gz
echo "============================================================"
echo -e "[[ $(date) ]] Building extracted archive...\n"
cd ${DIST_WORKSPACE}
bazel_args=(
test
--keep_going
--test_output=errors
--
//...
-//objectivec/... # only works on macOS
-//csharp/... # release builds require external dependencies
@com_google_protobuf_examples//...
)
${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh "${bazel_args[@]}"

@ -1,9 +0,0 @@
# Common config shared by presubmit and continuous.
bazel_setting: {
project_id: "protobuf-build"
bes_backend_address: "buildeventservice.googleapis.com"
foundry_backend_address: "remotebuildexecution.googleapis.com"
upsalite_frontend_address: "https://source.cloud.google.com"
local_execution: true
}

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/bazel_distcheck/build.sh"
timeout_mins: 15

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/bazel_distcheck/build.sh"
timeout_mins: 15

@ -1,60 +0,0 @@
#!/bin/bash
#
# Build file to set up and run tests based on distribution archive
set -eux
# Change to repo root
cd $(dirname $0)/../../..
#
# Update git submodules
#
git submodule update --init --recursive
#
# Build distribution archive
#
# TODO: this should use Bazel-built dist archives.
date ; ./autogen.sh
date ; ./configure
date ; make dist
date
DIST_ARCHIVE=( $(ls protobuf-*.tar.gz) )
if (( ${#DIST_ARCHIVE[@]} != 1 )); then
echo >&2 "Distribution archive not found. ${#DIST_ARCHIVE[@]} matches:"
echo >&2 "${DIST_ARCHIVE[@]}"
exit 1
fi
#
# Check for all expected files
#
kokoro/common/check_missing_dist_files.sh ${DIST_ARCHIVE}
#
# Extract to a temporary directory
#
if [[ -z ${DIST_WORK_ROOT:-} ]]; then
# If you want to preserve the extracted sources, set the DIST_WORK_ROOT
# environment variable to an existing directory that should be used.
DIST_WORK_ROOT=$(mktemp -d)
function cleanup_work_root() {
echo "Cleaning up temporary directory ${DIST_WORK_ROOT}..."
rm -rf ${DIST_WORK_ROOT}
}
trap cleanup_work_root EXIT
fi
tar -C ${DIST_WORK_ROOT} --strip-components=1 -axf ${DIST_ARCHIVE}
#
# Run tests using extracted sources
#
SOURCE_DIR=${DIST_WORK_ROOT} \
CMAKE_GENERATOR=Ninja \
CTEST_PARALLEL_LEVEL=$(nproc) \
kokoro/common/cmake.sh
echo "PASS"

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/cmake_distcheck/build.sh"
timeout_mins: 1440

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/cmake_distcheck/build.sh"
timeout_mins: 1440

@ -1,25 +0,0 @@
#!/bin/bash
#
# Build file to set up and run tests
set -ex # exit immediately on error
# Change to repo root
cd $(dirname $0)/../../..
./tests.sh cpp_distcheck
# Run tests under release docker image.
DOCKER_IMAGE_NAME=protobuf/protoc_$(sha1sum protoc-artifacts/Dockerfile | cut -f1 -d " ")
until docker pull $DOCKER_IMAGE_NAME; do sleep 10; done
docker run -v $(pwd):/var/local/protobuf --rm $DOCKER_IMAGE_NAME \
bash -l /var/local/protobuf/tests.sh cpp || FAILED="true"
# This directory is owned by root. We need to delete it, because otherwise
# Kokoro will attempt to rsync it and fail with a permission error.
rm -rf src/core
if [ "$FAILED" = "true" ]; then
exit 1
fi

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/cpp_distcheck/build.sh"
timeout_mins: 1440

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/cpp_distcheck/build.sh"
timeout_mins: 1440

@ -1,15 +0,0 @@
#!/bin/bash
#
# Build file to set up and run tests
set -ex # exit immediately on error
# Change to repo root
cd $(dirname $0)/../../..
export DOCKERHUB_ORGANIZATION=protobuftesting
export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/java_stretch
export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
export OUTPUT_DIR=testoutput
export TEST_SET="dist_install"
./kokoro/linux/build_and_run_docker.sh

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/dist_install/build.sh"
timeout_mins: 1440

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/dist_install/build.sh"
timeout_mins: 1440

@ -1,11 +0,0 @@
#!/bin/bash
#
# Build file to set up and run tests
# Change to repo root
cd $(dirname $0)/../../..
# Prepare worker environment to run tests
source kokoro/macos/prepare_build_macos_rc
./tests.sh cpp_distcheck

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/macos/cpp_distcheck/build.sh"
timeout_mins: 1440

@ -1,5 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/macos/cpp_distcheck/build.sh"
timeout_mins: 1440

@ -45,44 +45,6 @@ build_cpp_tcmalloc() {
PPROF_PATH=/usr/bin/google-pprof HEAPCHECK=strict ./protobuf-test
}
build_cpp_distcheck() {
grep -q -- "-Og" src/Makefile.am &&
echo "The -Og flag is incompatible with Clang versions older than 4.0." &&
exit 1
# Initialize any submodules.
git submodule update --init --recursive
./autogen.sh
./configure
make dist
# List all files that should be included in the distribution package.
git ls-files | grep "^\(java\|python\|objectivec\|csharp\|ruby\|php\|cmake\|examples\|src/google/protobuf/.*\.proto\)" |\
grep -v ".gitignore" | grep -v "java/lite/proguard.pgcfg" |\
grep -v "python/compatibility_tests" | grep -v "python/docs" | grep -v "python/.repo-metadata.json" |\
grep -v "python/protobuf_distutils" | grep -v "csharp/compatibility_tests" > dist.lst
# Unzip the dist tar file.
DIST=`ls *.tar.gz`
tar -xf $DIST
cd ${DIST//.tar.gz}
# Check if every file exists in the dist tar file.
FILES_MISSING=""
for FILE in $(<../dist.lst); do
[ -f "$FILE" ] || {
echo "$FILE is not found!"
FILES_MISSING="$FILE $FILES_MISSING"
}
done
cd ..
if [ ! -z "$FILES_MISSING" ]; then
echo "Missing files in EXTRA_DIST: $FILES_MISSING"
exit 1
fi
# Do the regular dist-check for C++.
make distcheck -j$(nproc)
}
build_dist_install() {
# Create a symlink pointing to python2 and put it at the beginning of $PATH.
# This is necessary because the googletest build system involves a Python
@ -539,7 +501,6 @@ build_benchmark() {
if [ "$#" -ne 1 ]; then
echo "
Usage: $0 { cpp |
cpp_distcheck |
csharp |
java_jdk7 |
java_oracle7 |

Loading…
Cancel
Save