Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase Kokoro testing reliability #902

Merged
merged 6 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 1 addition & 73 deletions .kokoro/tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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 *********"
Expand All @@ -71,75 +71,3 @@ mvn -B --fail-at-end clean verify -Dfile.encoding="UTF-16" \
-Dbigtable.instanceID=instance | \
grep -E -v "(^\[INFO\] Download|^\[INFO\].*skipping)"

echo "******** Deploy to prod *******"
cd appengine-java8

for app in "bigtable" "cloudsql" "datastore" "spanner" \
"urlfetch"
do
(cd "${app}"
sed --in-place='.xx' "s/<\/runtime>/<\/runtime><service>${app}<\/service>/" \
src/main/webapp/WEB-INF/appengine-web.xml
mvn -B --fail-at-end -q appengine:deploy -Dapp.deploy.version="1" \
-Dapp.stage.quickstart=true -Dapp.deploy.force=true -Dapp.deploy.promote=true \
-Dapp.deploy.project="${GOOGLE_CLOUD_PROJECT}" -DskipTests=true
mv src/main/webapp/WEB-INF/appengine-web.xml.xx src/main/webapp/WEB-INF/appengine-web.xml)
done

echo "******* Test prod Deployed Apps ********"
export URL="dot-${GOOGLE_CLOUD_PROJECT}.appspot.com"

# TestIt "helloworld" "" "Hello App Engine -- Java 8!"


## Run tests using App Engine local devserver.
# test_localhost() {
# git clone https://github.com/GoogleCloudPlatform/java-repo-tools.git
#
# devserver_tests=(
# appengine/helloworld
# appengine/datastore/indexes
# appengine/datastore/indexes-exploding
# appengine/datastore/indexes-perfect
# )
# for testdir in "${devserver_tests[@]}" ; do
# if [ -z "$common_dir" ] || [[ $testdir = $common_dir* ]]; then
# ./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}"
# fi
# done

# newplugin_std_tests=(
# appengine/helloworld-new-plugins
# )
# for testdir in "${newplugin_std_tests[@]}" ; do
# ./java-repo-tools/scripts/test-localhost.sh standard_mvn "${testdir}"
# ./java-repo-tools/scripts/test-localhost.sh standard_gradle "${testdir}"
# done
}
test_localhost



# (
# # Stop echoing commands, so we don't leak secret env vars
# # -Pselenium | \ # LV3 20170616 turn off selenium for now.
# set +x
# mvn --batch-mode clean verify \
# -Dbookshelf.clientID="${OAUTH2_CLIENT_ID}" \
# -Dbookshelf.clientSecret="${OAUTH2_CLIENT_SECRET}" \
# -Dbookshelf.bucket="${GCS_BUCKET envvar is unset}" \
# | \
# grep -E -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
# )
#
# Test running samples on localhost.
# git clone https://github.com/GoogleCloudPlatform/java-repo-tools.git
# ./java-repo-tools/scripts/test-localhost.sh jetty helloworld-jsp -- -DskipTests=true
# ./java-repo-tools/scripts/test-localhost.sh jetty helloworld-servlet -- -DskipTests=true
# ./java-repo-tools/scripts/test-localhost.sh jetty helloworld-compat -- -DskipTests=true
# ./java-repo-tools/scripts/test-localhost.sh spring-boot helloworld-springboot -- -DskipTests=true

# Check that all shell scripts in this repo (including this one) pass the
# Shell Check linter.
cd ..
shellcheck ./**/*.sh
17 changes: 0 additions & 17 deletions circle.yml

This file was deleted.

Binary file removed gae-firebase-secrets.json.enc
Binary file not shown.
81 changes: 0 additions & 81 deletions jenkins.sh

This file was deleted.

21 changes: 13 additions & 8 deletions kms/src/main/java/com/example/Snippets.java
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,18 @@ public static void listCryptoKeys(String projectId, String locationId, String ke
"projects/%s/locations/%s/keyRings/%s",
projectId, locationId, keyRingId);

ListCryptoKeysResponse cryptoKeys = kms.projects().locations().keyRings()
.cryptoKeys()
.list(keyRingPath)
.execute();

for (CryptoKey key : cryptoKeys.getCryptoKeys()) {
System.out.println(key);
}
ListCryptoKeysResponse cryptoKeys = null;
do { // Print every page of keys
cryptoKeys = kms.projects().locations().keyRings()
.cryptoKeys()
.list(keyRingPath)
.setPageToken(cryptoKeys != null ? cryptoKeys.getNextPageToken() : null)
.execute();

for (CryptoKey key : cryptoKeys.getCryptoKeys()) {
System.out.println(key);
}
} while(cryptoKeys.getNextPageToken() != null);
}

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


ListCryptoKeyVersionsResponse versions = kms.projects().locations().keyRings().cryptoKeys()
.cryptoKeyVersions()
.list(cryptoKeys)
Expand Down
3 changes: 0 additions & 3 deletions secrets.env.EXAMPLE

This file was deleted.

1 change: 0 additions & 1 deletion secrets.env.enc

This file was deleted.

Binary file removed service-account.json.enc
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public class TranslateTextTest {
// Assert
String got = bout.toString();
for (String language : languages) {
assertThat(got).contains(language);
bout.reset();
out.print(language);
assertThat(got).contains(bout.toString());
}
}

Expand Down
118 changes: 0 additions & 118 deletions travis.sh

This file was deleted.