Skip to content

Commit a2e305f

Browse files
authored
Merge pull request #902 from GoogleCloudPlatform/kokoro
Increase Kokoro testing reliability
2 parents b3e6920 + 6c686ca commit a2e305f

File tree

10 files changed

+17
-302
lines changed

10 files changed

+17
-302
lines changed

.kokoro/tests/run_tests.sh

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-acct.json
4545
export GOOGLE_CLOUD_PROJECT=java-docs-samples-testing
4646
export PATH=/google-cloud-sdk/bin:$PATH
4747
source ${KOKORO_GFILE_DIR}/aws-secrets.sh
48-
48+
source ${KOKORO_GFILE_DIR}/dlp_secrets.txt
4949
echo "******** Environment *********"
5050
env
5151
echo "******** mvn & Java *********"
@@ -71,75 +71,3 @@ mvn -B --fail-at-end clean verify -Dfile.encoding="UTF-16" \
7171
-Dbigtable.instanceID=instance | \
7272
grep -E -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
7373

74-
echo "******** Deploy to prod *******"
75-
cd appengine-java8
76-
77-
for app in "bigtable" "cloudsql" "datastore" "spanner" \
78-
"urlfetch"
79-
do
80-
(cd "${app}"
81-
sed --in-place='.xx' "s/<\/runtime>/<\/runtime><service>${app}<\/service>/" \
82-
src/main/webapp/WEB-INF/appengine-web.xml
83-
mvn -B --fail-at-end -q appengine:deploy -Dapp.deploy.version="1" \
84-
-Dapp.stage.quickstart=true -Dapp.deploy.force=true -Dapp.deploy.promote=true \
85-
-Dapp.deploy.project="${GOOGLE_CLOUD_PROJECT}" -DskipTests=true
86-
mv src/main/webapp/WEB-INF/appengine-web.xml.xx src/main/webapp/WEB-INF/appengine-web.xml)
87-
done
88-
89-
echo "******* Test prod Deployed Apps ********"
90-
export URL="dot-${GOOGLE_CLOUD_PROJECT}.appspot.com"
91-
92-
# TestIt "helloworld" "" "Hello App Engine -- Java 8!"
93-
94-
95-
## Run tests using App Engine local devserver.
96-
# test_localhost() {
97-
# git clone https://github.com/GoogleCloudPlatform/java-repo-tools.git
98-
#
99-
# devserver_tests=(
100-
# appengine/helloworld
101-
# appengine/datastore/indexes
102-
# appengine/datastore/indexes-exploding
103-
# appengine/datastore/indexes-perfect
104-
# )
105-
# for testdir in "${devserver_tests[@]}" ; do
106-
# if [ -z "$common_dir" ] || [[ $testdir = $common_dir* ]]; then
107-
# ./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}"
108-
# fi
109-
# done
110-
111-
# newplugin_std_tests=(
112-
# appengine/helloworld-new-plugins
113-
# )
114-
# for testdir in "${newplugin_std_tests[@]}" ; do
115-
# ./java-repo-tools/scripts/test-localhost.sh standard_mvn "${testdir}"
116-
# ./java-repo-tools/scripts/test-localhost.sh standard_gradle "${testdir}"
117-
# done
118-
}
119-
test_localhost
120-
121-
122-
123-
# (
124-
# # Stop echoing commands, so we don't leak secret env vars
125-
# # -Pselenium | \ # LV3 20170616 turn off selenium for now.
126-
# set +x
127-
# mvn --batch-mode clean verify \
128-
# -Dbookshelf.clientID="${OAUTH2_CLIENT_ID}" \
129-
# -Dbookshelf.clientSecret="${OAUTH2_CLIENT_SECRET}" \
130-
# -Dbookshelf.bucket="${GCS_BUCKET envvar is unset}" \
131-
# | \
132-
# grep -E -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
133-
# )
134-
#
135-
# Test running samples on localhost.
136-
# git clone https://github.com/GoogleCloudPlatform/java-repo-tools.git
137-
# ./java-repo-tools/scripts/test-localhost.sh jetty helloworld-jsp -- -DskipTests=true
138-
# ./java-repo-tools/scripts/test-localhost.sh jetty helloworld-servlet -- -DskipTests=true
139-
# ./java-repo-tools/scripts/test-localhost.sh jetty helloworld-compat -- -DskipTests=true
140-
# ./java-repo-tools/scripts/test-localhost.sh spring-boot helloworld-springboot -- -DskipTests=true
141-
142-
# Check that all shell scripts in this repo (including this one) pass the
143-
# Shell Check linter.
144-
cd ..
145-
shellcheck ./**/*.sh

circle.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

gae-firebase-secrets.json.enc

-2.31 KB
Binary file not shown.

jenkins.sh

Lines changed: 0 additions & 81 deletions
This file was deleted.

kms/src/main/java/com/example/Snippets.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,18 @@ public static void listCryptoKeys(String projectId, String locationId, String ke
522522
"projects/%s/locations/%s/keyRings/%s",
523523
projectId, locationId, keyRingId);
524524

525-
ListCryptoKeysResponse cryptoKeys = kms.projects().locations().keyRings()
526-
.cryptoKeys()
527-
.list(keyRingPath)
528-
.execute();
529-
530-
for (CryptoKey key : cryptoKeys.getCryptoKeys()) {
531-
System.out.println(key);
532-
}
525+
ListCryptoKeysResponse cryptoKeys = null;
526+
do { // Print every page of keys
527+
cryptoKeys = kms.projects().locations().keyRings()
528+
.cryptoKeys()
529+
.list(keyRingPath)
530+
.setPageToken(cryptoKeys != null ? cryptoKeys.getNextPageToken() : null)
531+
.execute();
532+
533+
for (CryptoKey key : cryptoKeys.getCryptoKeys()) {
534+
System.out.println(key);
535+
}
536+
} while(cryptoKeys.getNextPageToken() != null);
533537
}
534538

535539
/**
@@ -546,6 +550,7 @@ public static void listCryptoKeyVersions(
546550
"projects/%s/locations/%s/keyRings/%s/cryptoKeys/%s",
547551
projectId, locationId, keyRingId, cryptoKeyId);
548552

553+
549554
ListCryptoKeyVersionsResponse versions = kms.projects().locations().keyRings().cryptoKeys()
550555
.cryptoKeyVersions()
551556
.list(cryptoKeys)

secrets.env.EXAMPLE

Lines changed: 0 additions & 3 deletions
This file was deleted.

secrets.env.enc

Lines changed: 0 additions & 1 deletion
This file was deleted.

service-account.json.enc

-2.36 KB
Binary file not shown.

translate/src/test/java/com/example/cloud/translate/samples/TranslateTextTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public class TranslateTextTest {
9494
// Assert
9595
String got = bout.toString();
9696
for (String language : languages) {
97-
assertThat(got).contains(language);
97+
bout.reset();
98+
out.print(language);
99+
assertThat(got).contains(bout.toString());
98100
}
99101
}
100102

travis.sh

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)