Skip to content
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
182 changes: 0 additions & 182 deletions .github/workflows/java-bigtable-ci.yaml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/java-bigtable-emulator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Github action job to test core java library features on
# downstream client libraries before they are released.
permissions:
contents: read

on:
push:
branches:
- main
pull_request:
name: java-bigtable emulator
env:
BUILD_SUBDIR: java-bigtable
jobs:
filter:
runs-on: ubuntu-latest
outputs:
library: ${{ steps.filter.outputs.library }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: dorny/paths-filter@d1c1ffe0248fe513906c8e24db8ea791d46f8590 # v3.0.3
id: filter
with:
filters: |
library:
- 'java-bigtable/**'
emulator:
needs: filter
if: ${{ needs.filter.outputs.library == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
distribution: temurin
java-version: 17
cache: maven
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: integration-single
TEST_ALL_MODULES: "true"
INTEGRATION_TEST_ARGS: "-P bigtable-emulator-it"
2 changes: 1 addition & 1 deletion .kokoro/presubmit/bigtable-integration.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env_vars: {

env_vars: {
key: "INTEGRATION_TEST_ARGS"
value: "-P bigtable-emulator-it,bigtable-prod-it,bigtable-prod-batch-it,enable-verbose-grpc-logs -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests -Dbigtable.kms_key_name=projects/gcloud-devel/locations/us-east1/keyRings/cmek-test-key-ring/cryptoKeys/cmek-test-key -Dbigtable.wait-for-cmek-key-status=true"
value: "-P bigtable-prod-it,enable-verbose-grpc-logs -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests -Dbigtable.kms_key_name=projects/gcloud-devel/locations/us-east1/keyRings/cmek-test-key-ring/cryptoKeys/cmek-test-key -Dbigtable.wait-for-cmek-key-status=true"
}

env_vars: {
Expand Down
31 changes: 14 additions & 17 deletions java-bigtable/scripts/setup-test-table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

# Set up a table to use for integration tests.

# Usage: ./scripts/setup-test-table.sh projects/<project-id>/instances/<instance-id>/tables/<table-id> [admin-endpoint]
# Environment overrides: ADMIN_HOST, ZONE

set -e
set -u

ADMIN_HOSTS=(
"bigtableadmin.googleapis.com:443"
"test-bigtableadmin.sandbox.googleapis.com:443"
)

ZONE=us-central1-b
ZONE=${ZONE:-us-central1-b}
FAMILY=cf

# Format: projects/<project-id>/instances/<instance-id>/tables/<table-id>
TABLE_NAME=$1
ADMIN_HOST=${2:-${ADMIN_HOST:-bigtableadmin.googleapis.com:443}}

if [[ ${TABLE_NAME} =~ projects\/([^/]+)\/instances\/([^/]+)\/tables\/([^/]+) ]]; then
PROJECT_ID=${BASH_REMATCH[1]}
Expand All @@ -29,14 +28,12 @@ call_cbt() {
cbt -admin-endpoint="${ADMIN_HOST}" -project "${PROJECT_ID}" -instance "${INSTANCE_ID}" "$@"
}

for ADMIN_HOST in "${ADMIN_HOSTS[@]}"; do
# Ensure that the instance exists.
if ! call_cbt listinstances | grep -q "${INSTANCE_ID}"; then
call_cbt createinstance "${INSTANCE_ID}" "${INSTANCE_ID}" "${INSTANCE_ID}-c0" "${ZONE}" 1 SSD
fi

# Ensure that the table exists
if ! call_cbt -instance "$INSTANCE_ID" ls | grep -q "^${TABLE_ID}\$"; then
call_cbt createtable "$TABLE_ID" "families=$FAMILY:maxversions=1||maxage=1h"
fi
done
# Ensure that the instance exists.
if ! call_cbt listinstances | grep -Eq "^${INSTANCE_ID}([[:space:]]|$)"; then
call_cbt createinstance "${INSTANCE_ID}" "${INSTANCE_ID}" "${INSTANCE_ID}-c0" "${ZONE}" 1 SSD
fi

# Ensure that the table exists.
if ! call_cbt -instance "$INSTANCE_ID" ls | grep -q "^${TABLE_ID}\$"; then
call_cbt createtable "$TABLE_ID" "families=$FAMILY:maxversions=1||maxage=1h"
fi
Loading