Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
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
2 changes: 2 additions & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ branchProtectionRules:
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- 'Kokoro - Against Pub/Sub Lite samples'
Comment thread
anguillanneuf marked this conversation as resolved.
- cla/google
- pattern: 1.111.0-sp
isAdminEnforced: true
Expand All @@ -33,6 +34,7 @@ branchProtectionRules:
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- 'Kokoro - Against Pub/Sub Lite samples'
- cla/google
permissionRules:
- team: yoshi-admins
Expand Down
35 changes: 35 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,41 @@ samples)
SAMPLES_DIR=samples/snapshot
fi

if [[ -f ${SAMPLES_DIR}/pom.xml ]]
then
for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do
[[ -f "$FILE" ]] || continue
source "$FILE"
done

pushd ${SAMPLES_DIR}
mvn -B \
-Penable-samples \
-ntp \
-DtrimStackTrace=false \
-Dclirr.skip=true \
-Denforcer.skip=true \
-fae \
verify
RETURN_CODE=$?
popd
else
echo "no sample pom.xml found - skipping sample tests"
fi
;;
presubmit-against-pubsublite-samples)
## cd to the directory one level above the root of the repo
cd ${scriptDir}/../..
git clone https://github.com/googleapis/java-pubsublite.git
pushd java-pubsublite/

SAMPLES_DIR=samples
# Only run ITs in in snippets/ on presubmit PRs.
if [[ ! -z ${KOKORO_GITHUB_PULL_REQUEST_NUMBER} ]]
then
SAMPLES_DIR=samples/snippets
fi

if [[ -f ${SAMPLES_DIR}/pom.xml ]]
then
for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do
Expand Down
38 changes: 38 additions & 0 deletions .kokoro/presubmit/presubmit-against-pubsublite-samples.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/java11"
}

env_vars: {
key: "JOB_TYPE"
value: "presubmit-against-pubsublite-samples"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "java-docs-samples-testing"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "java-docs-samples-testing"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT_NUMBER"
value: "779844219229"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-docs-samples-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-docs-samples-service-account"
}
2 changes: 2 additions & 0 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,4 +524,6 @@

java.common_templates(excludes=[
".github/workflows/samples.yaml",
".kokoro/build.sh",
".github/sync-repo-settings.yaml",
])