Create test to verify that the dist artifact can be installed. (#5854)

* Add a new test for verifying that the dist package can be installed.
pull/5855/head
Hao Nguyen 6 years ago committed by GitHub
parent e2dd7403bc
commit f85c823c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      kokoro/linux/dist_install/build.sh
  2. 5
      kokoro/linux/dist_install/continuous.cfg
  3. 5
      kokoro/linux/dist_install/presubmit.cfg
  4. 33
      tests.sh

@ -0,0 +1,15 @@
#!/bin/bash
#
# Build file to set up and run tests
set -ex # exit immediately on error
# Change to repo root
cd $(dirname $0)/../../..
# Run tests under release docker image.
export DOCKERFILE_DIR=kokoro/linux/64-bit
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

@ -0,0 +1,5 @@
# 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

@ -0,0 +1,5 @@
# 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

@ -80,6 +80,38 @@ build_cpp_distcheck() {
make distcheck -j$(nproc)
}
build_dist_install() {
# Initialize any submodules.
git submodule update --init --recursive
./autogen.sh
./configure
make dist
# Unzip the dist tar file and install it.
DIST=`ls *.tar.gz`
tar -xf $DIST
pushd ${DIST//.tar.gz}
./configure && make check -j4 && make install
export LD_LIBRARY_PATH=/usr/local/lib
# Try to install Java
pushd java
use_java jdk7
$MVN install
popd
# Try to install Python
virtualenv --no-site-packages venv
source venv/bin/activate
pushd python
python setup.py clean build sdist
pip install dist/protobuf-*.tar.gz
popd
deactivate
rm -rf python/venv
}
build_csharp() {
# Required for conformance tests and to regenerate protos.
internal_build_cpp
@ -653,6 +685,7 @@ Usage: $0 { cpp |
php7.1 |
php7.1_c |
php_all |
dist_install |
benchmark)
"
exit 1

Loading…
Cancel
Save