Skip to content

Commit 404dc08

Browse files
authored
Consolidate and cleanup Kokoro test script. (#1006)
* Consolidate and cleanup test run file. * Remove echoing.
1 parent 8148785 commit 404dc08

File tree

1 file changed

+18
-44
lines changed

1 file changed

+18
-44
lines changed

.kokoro/tests/run_tests.sh

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,59 +15,33 @@
1515

1616
set -eo pipefail
1717
shopt -s globstar
18-
19-
set -xe
2018
# We spin up some subprocesses. Don't kill them on hangup
2119
trap '' HUP
2220

23-
echo "**** ENVIRONMENT ****"
24-
env
25-
26-
export MAVEN_OPTS='-Xmx800m -Xms400m'
27-
28-
# Temporary directory to store any output to display on error
29-
export ERROR_OUTPUT_DIR="$(mktemp -d)"
30-
trap 'rm -r "${ERROR_OUTPUT_DIR}"' EXIT
31-
32-
# $1 - project
33-
# $2 - PATH
34-
# $3 - search string
35-
function TestIt() {
36-
curl -s --show-error "https://${1}-${URL}/${2}" | \
37-
tee -a "${ERROR_OUTPUT_DIR}/response.txt" | \
38-
grep "${3}"
39-
if [ "${?}" -ne 0 ]; then
40-
echo "${1}/${2} ****** NOT FOUND"
41-
fi
42-
}
43-
21+
# Update gcloud and check version
22+
gcloud components update --quiet
23+
echo "********** GCLOUD INFO ***********"
24+
gcloud -v
25+
echo "********** MAVEN INFO ***********"
26+
mvn -v
27+
echo "********** GRADLE INFO ***********"
28+
gradle -v
29+
30+
# Setup required enviormental variables
4431
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-acct.json
4532
export GOOGLE_CLOUD_PROJECT=java-docs-samples-testing
46-
export PATH=/google-cloud-sdk/bin:$PATH
4733
source ${KOKORO_GFILE_DIR}/aws-secrets.sh
4834
source ${KOKORO_GFILE_DIR}/dlp_secrets.txt
49-
echo "******** Environment *********"
50-
env
51-
echo "******** mvn & Java *********"
52-
mvn -version
53-
54-
echo "Update gcloud ********"
55-
gcloud components update --quiet
56-
57-
echo "******** activate-service-account ********"
58-
ls -lr ${KOKORO_GFILE_DIR}
59-
35+
# Activate service account
6036
gcloud auth activate-service-account\
6137
--key-file=$GOOGLE_APPLICATION_CREDENTIALS \
6238
--project=$GOOGLE_CLOUD_PROJECT
6339

64-
echo "********* gcloud config ********"
65-
gcloud config list
66-
67-
echo "******** build everything ********"
40+
# Run the tests
6841
cd github/java-docs-samples
69-
mvn -B --fail-at-end clean verify -Dfile.encoding="UTF-16" \
70-
-Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \
71-
-Dbigtable.instanceID=instance | \
72-
grep -E -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
73-
42+
mvn --batch-mode --fail-at-end clean verify \
43+
-Dfile.encoding="UTF-8" \
44+
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
45+
-Dmaven.test.redirectTestOutputToFile=true \
46+
-Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \
47+
-Dbigtable.instanceID=instance

0 commit comments

Comments
 (0)