From 34f52a12a8af938a8209e5a0f79491c3b6ce2b8f Mon Sep 17 00:00:00 2001 From: Kurtis Van Gent Date: Wed, 24 Jan 2018 11:18:05 -0800 Subject: [PATCH 1/2] Consolidate and cleanup test run file. --- .kokoro/tests/run_tests.sh | 64 +++++++++++--------------------------- pom.xml | 4 +++ 2 files changed, 23 insertions(+), 45 deletions(-) diff --git a/.kokoro/tests/run_tests.sh b/.kokoro/tests/run_tests.sh index 969b12dd885..727fabb8051 100755 --- a/.kokoro/tests/run_tests.sh +++ b/.kokoro/tests/run_tests.sh @@ -13,61 +13,35 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eo pipefail +set -xeo pipefail shopt -s globstar - -set -xe # We spin up some subprocesses. Don't kill them on hangup trap '' HUP -echo "**** ENVIRONMENT ****" -env - -export MAVEN_OPTS='-Xmx800m -Xms400m' - -# Temporary directory to store any output to display on error -export ERROR_OUTPUT_DIR="$(mktemp -d)" -trap 'rm -r "${ERROR_OUTPUT_DIR}"' EXIT - -# $1 - project -# $2 - PATH -# $3 - search string -function TestIt() { - curl -s --show-error "https://${1}-${URL}/${2}" | \ - tee -a "${ERROR_OUTPUT_DIR}/response.txt" | \ - grep "${3}" - if [ "${?}" -ne 0 ]; then - echo "${1}/${2} ****** NOT FOUND" - fi -} - +# Update gcloud and check version +gcloud components update --quiet +echo "********** GCLOUD INFO ***********" +gcloud -v +echo "********** MAVEN INFO ***********" +mvn -v +echo "********** GRADLE INFO ***********" +gradle -v + +# Setup required enviormental variables export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-acct.json export GOOGLE_CLOUD_PROJECT=java-docs-samples-testing -export PATH=/google-cloud-sdk/bin:$PATH source ${KOKORO_GFILE_DIR}/aws-secrets.sh source ${KOKORO_GFILE_DIR}/dlp_secrets.txt -echo "******** Environment *********" -env -echo "******** mvn & Java *********" -mvn -version - -echo "Update gcloud ********" -gcloud components update --quiet - -echo "******** activate-service-account ********" -ls -lr ${KOKORO_GFILE_DIR} - +# Activate service account gcloud auth activate-service-account\ --key-file=$GOOGLE_APPLICATION_CREDENTIALS \ --project=$GOOGLE_CLOUD_PROJECT -echo "********* gcloud config ********" -gcloud config list - -echo "******** build everything ********" +# Run the tests cd github/java-docs-samples -mvn -B --fail-at-end clean verify -Dfile.encoding="UTF-16" \ - -Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \ - -Dbigtable.instanceID=instance | \ - grep -E -v "(^\[INFO\] Download|^\[INFO\].*skipping)" - +mvn --batch-mode --fail-at-end clean verify \ + -Dfile.encoding="UTF-8" \ + -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ + -Dmaven.test.redirectTestOutputToFile=true \ + -Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \ + -Dbigtable.instanceID=instance diff --git a/pom.xml b/pom.xml index eb3b98e070b..66d35eac9f6 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,10 @@ doc-samples pom + + 3.0 + +