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.
diff --git a/kokoro/linux/dist_install/build.sh b/kokoro/linux/dist_install/build.sh
new file mode 100755
index 0000000..81a0516
--- /dev/null
+++ b/kokoro/linux/dist_install/build.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
diff --git a/kokoro/linux/dist_install/continuous.cfg b/kokoro/linux/dist_install/continuous.cfg
new file mode 100644
index 0000000..b1e0b20
--- /dev/null
+++ b/kokoro/linux/dist_install/continuous.cfg
@@ -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
diff --git a/kokoro/linux/dist_install/presubmit.cfg b/kokoro/linux/dist_install/presubmit.cfg
new file mode 100644
index 0000000..b1e0b20
--- /dev/null
+++ b/kokoro/linux/dist_install/presubmit.cfg
@@ -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
diff --git a/tests.sh b/tests.sh
index b7ccf8f..09edfbf 100755
--- a/tests.sh
+++ b/tests.sh
@@ -80,6 +80,38 @@
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 @@
php7.1 |
php7.1_c |
php_all |
+ dist_install |
benchmark)
"
exit 1