From a45d07bcb51e4f73b897a58d9734793ac2672220 Mon Sep 17 00:00:00 2001 From: zpencer Date: Wed, 14 Feb 2018 16:44:02 -0800 Subject: [PATCH] build: run unit tests on osx, ensure proto output included (#4081) This adds back functionality that was accidentally dropped when porting from travis: - make sure generating protos will not lead to any uncomitted changes - actually run the unit tests --- buildscripts/kokoro/unix.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/buildscripts/kokoro/unix.sh b/buildscripts/kokoro/unix.sh index d3ef563c1e..255748d09f 100755 --- a/buildscripts/kokoro/unix.sh +++ b/buildscripts/kokoro/unix.sh @@ -50,8 +50,17 @@ export LD_LIBRARY_PATH=/tmp/protobuf/lib export LDFLAGS=-L/tmp/protobuf/lib export CXXFLAGS="-I/tmp/protobuf/include" -# Run tests +# Ensure all *.proto changes include *.java generated code ./gradlew assemble generateTestProto install $GRADLE_FLAGS + +if [[ -z "${SKIP_CLEAN_CHECK:-}" && ! -z $(git status --porcelain) ]]; then + git status + echo "Error Working directory is not clean. Forget to commit generated files?" + exit 1 +fi + +# Run tests +./gradlew build pushd examples ./gradlew build $GRADLE_FLAGS # --batch-mode reduces log spam