Skip to content

Commit

Permalink
Tag Java GCPKMS tests as manual and update Kokoro accordingly.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 466213887
  • Loading branch information
chuckx authored and copybara-github committed Aug 9, 2022
1 parent 39602ef commit 826e8b7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ java_test(
size = "small",
srcs = ["KmsAeadKeyManagerWithGcpTest.java"],
data = ["//testdata/gcp:credentials"],
tags = ["no_rbe"],
tags = [
"manual",
"no_rbe",
"requires-network",
],
deps = [
"//src/main/java/com/google/crypto/tink:aead",
"//src/main/java/com/google/crypto/tink:registry_cluster",
Expand All @@ -40,7 +44,11 @@ java_test(
size = "small",
srcs = ["KmsEnvelopeAeadKeyManagerWithGcpTest.java"],
data = ["//testdata/gcp:credentials"],
tags = ["no_rbe"],
tags = [
"manual",
"no_rbe",
"requires-network",
],
deps = [
"//proto:tink_java_proto",
"//src/main/java/com/google/crypto/tink:aead",
Expand Down
18 changes: 13 additions & 5 deletions kokoro/gcp_ubuntu_per_language/java_src/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,23 @@ test_build_bazel_file() {

if [[ -n "${KOKORO_ROOT:-}" ]] ; then
cd "${KOKORO_ARTIFACTS_DIR}/git/tink"
use_bazel.sh "$(cat java_src/.bazelversion)"
fi

./kokoro/testutils/copy_credentials.sh "java_src/testdata"
./kokoro/testutils/update_android_sdk.sh

pushd java_src
use_bazel.sh "$(cat .bazelversion)"
bazel build ...
bazel test --test_output=errors -- ...
popd
# Run manual tests which rely on key material injected into the Kokoro
# environement.
MANUAL_TARGETS=()
if [[ -n "${KOKORO_ROOT:-}" ]]; then
MANUAL_TARGETS+=(
"//src/test/java/com/google/crypto/tink/integration/gcpkms:KmsAeadKeyManagerWithGcpTest"
"//src/test/java/com/google/crypto/tink/integration/gcpkms:KmsEnvelopeAeadKeyManagerWithGcpTest"
)
fi
readonly MANUAL_TARGETS

./kokoro/testutils/run_bazel_tests.sh java_src "${MANUAL_TARGETS[@]}"

test_build_bazel_file
12 changes: 11 additions & 1 deletion kokoro/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,17 @@ run_all_linux_tests() {
if [[ "${KOKORO_JOB_NAME:-}" =~ ^tink/github \
|| -z "${KOKORO_JOB_NAME+x}" ]]; then
run_linux_tests "cc"
run_linux_tests "java_src"

local -a MANUAL_JAVA_TARGETS
if [[ -n "${KOKORO_ROOT}" ]]; then
MANUAL_JAVA_TARGETS+=(
"//src/test/java/com/google/crypto/tink/integration/gcpkms:KmsAeadKeyManagerWithGcpTest"
"//src/test/java/com/google/crypto/tink/integration/gcpkms:KmsEnvelopeAeadKeyManagerWithGcpTest"
)
fi
readonly MANUAL_JAVA_TARGETS
run_linux_tests "java_src" "${MANUAL_JAVA_TARGETS[@]}"

run_linux_tests "go"
run_linux_tests "python"
run_linux_tests "tools"
Expand Down

0 comments on commit 826e8b7

Please sign in to comment.