Skip to content

Commit

Permalink
Merge branch 'main' into junit-migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
burkedavison committed May 9, 2024
2 parents 8010c15 + 69f5aec commit 0ceb522
Show file tree
Hide file tree
Showing 12 changed files with 269 additions and 193 deletions.
46 changes: 46 additions & 0 deletions .cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 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.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'

steps:
- name: gcr.io/cloud-builders/docker
args: [
"build",
"-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}",
"--file", "graalvm_a.Dockerfile",
"--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION",
"."
]
dir: .cloudbuild/graalvm
id: graalvm-a-build
waitFor: ["-"]

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
waitFor: [ "graalvm-a-build" ]
entrypoint: java
args: [ '-version' ]
id: java-version

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
waitFor: [ "graalvm-a-build" ]
id: native-java-kms
env:
- 'MODULES_UNDER_TEST=java-kms'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
46 changes: 46 additions & 0 deletions .cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 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.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'

steps:
- name: gcr.io/cloud-builders/docker
args: [
"build",
"-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}",
"--file", "graalvm_a.Dockerfile",
"--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION",
"."
]
dir: .cloudbuild/graalvm
id: graalvm-a-build
waitFor: ["-"]

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
waitFor: [ "graalvm-a-build" ]
entrypoint: java
args: [ '-version' ]
id: java-version

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
waitFor: [ "graalvm-a-build" ]
id: native-java-kmsinventory
env:
- 'MODULES_UNDER_TEST=java-kmsinventory'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
13 changes: 9 additions & 4 deletions .cloudbuild/graalvm/cloudbuild-test-a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ steps:
dir: .cloudbuild/graalvm
id: graalvm-a-build
waitFor: ["-"]

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
waitFor: [ "graalvm-a-build" ]
entrypoint: java
args: [ '-version' ]
id: java-version

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
args: [ './.kokoro/presubmit/showcase-native.sh' ]
waitFor: [ "graalvm-a-build" ]
env:
- 'MODULES_UNDER_TEST=java-kms'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
id: native-showcase
45 changes: 45 additions & 0 deletions .cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2024 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.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'

steps:
- name: gcr.io/cloud-builders/docker
args: [
"build",
"-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}",
"--file", "graalvm_b.Dockerfile",
"--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION",
"."
]
dir: .cloudbuild/graalvm
id: graalvm-b-build
waitFor: ["-"]

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
waitFor: [ "graalvm-b-build" ]
entrypoint: java
args: [ '-version' ]
id: java-version

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
waitFor: [ "graalvm-b-build" ]
env:
- 'MODULES_UNDER_TEST=java-kms'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
46 changes: 46 additions & 0 deletions .cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2024 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.

timeout: 7200s # 2 hours
substitutions:
_SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current}
_JAVA_SHARED_CONFIG_VERSION: '1.7.7'

steps:
- name: gcr.io/cloud-builders/docker
args: [
"build",
"-t", "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}",
"--file", "graalvm_b.Dockerfile",
"--build-arg", "JAVA_SHARED_CONFIG_VERSION=$_JAVA_SHARED_CONFIG_VERSION",
"."
]
dir: .cloudbuild/graalvm
id: graalvm-b-build
waitFor: ["-"]

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
waitFor: [ "graalvm-b-build" ]
entrypoint: java
args: [ '-version' ]
id: java-version

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
waitFor: [ "graalvm-b-build" ]
id: native-java-kmsinventory
env:
- 'MODULES_UNDER_TEST=java-kmsinventory'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
13 changes: 9 additions & 4 deletions .cloudbuild/graalvm/cloudbuild-test-b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ steps:
dir: .cloudbuild/graalvm
id: graalvm-b-build
waitFor: ["-"]

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
waitFor: [ "graalvm-b-build" ]
entrypoint: java
args: [ '-version' ]
id: java-version

- name: gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:${_SHARED_DEPENDENCIES_VERSION}
entrypoint: bash
args: [ './.kokoro/presubmit/downstream-build.sh' ]
args: [ './.kokoro/presubmit/showcase-native.sh' ]
waitFor: [ "graalvm-b-build" ]
env:
- 'MODULES_UNDER_TEST=java-kms'
- 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-test'
id: native-showcase
33 changes: 0 additions & 33 deletions .kokoro/presubmit/common.cfg

This file was deleted.

35 changes: 3 additions & 32 deletions .kokoro/presubmit/downstream-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ if [ -z "${MODULES_UNDER_TEST}" ]; then
echo "MODULES_UNDER_TEST must be set to run downstream-build.sh"
exit 1
fi
# Use default value for REPOS_UNDER_TEST if unset. If set to empty string, maintain empty string.
#
# java-storage is currently the only downstream repo that doesn't require cloud resources for its
# GraalVM integration tests.
REPOS_UNDER_TEST=${REPOS_UNDER_TEST-"java-storage"}

## Get the directory of the build script
scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
Expand All @@ -34,10 +29,11 @@ source "$scriptDir/common.sh"
mkdir -p "${HOME}/.m2"
cp settings.xml "${HOME}/.m2"

### Round 1
# Publish this repo's modules to local maven to make them available for downstream libraries
mvn install --projects '!gapic-generator-java' \
-Danimal.sniffer.skip \
-Dcheckstyle.skip \
-Dclirr.skip \
-Dfmt.skip \
-DskipTests \
-B -ntp \
Expand All @@ -46,42 +42,17 @@ mvn install --projects '!gapic-generator-java' \

SHARED_DEPS_VERSION=$(parse_pom_version java-shared-dependencies)

### Round 2 : Run showcase integration tests in GraalVM
pushd showcase/gapic-showcase
SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)
popd
# Start showcase server
mkdir -p /usr/src/showcase
curl \
--location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz \
--output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz
pushd /usr/src/showcase/
tar -xf showcase-*
./gapic-showcase run &
popd
# Run showcase tests with `native` profile
pushd showcase
mvn test -Pnative,-showcase \
-Denforcer.skip=true \
-Dcheckstyle.skip \
-Dfmt.skip \
-ntp -B \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
popd

### Round 3
# Update the shared-dependencies version in google-cloud-jar-parent
git clone "https://github.com/googleapis/google-cloud-java.git" --depth=1
update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies "$SHARED_DEPS_VERSION"

### Round 4
# Run the updated java-shared-dependencies BOM against google-cloud-java integration tests
cd google-cloud-java
source ./.kokoro/common.sh
RETURN_CODE=0
setup_application_credentials
setup_cloud "$MODULES_UNDER_TEST"
install_modules "$MODULES_UNDER_TEST"
run_graalvm_tests "$MODULES_UNDER_TEST"
# Exit must occur in google-cloud-java directory to correctly destroy IT resources
exit "$RETURN_CODE"
63 changes: 63 additions & 0 deletions .kokoro/presubmit/showcase-native.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
# Copyright 2024 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.

set -eo pipefail

## Get the directory of the build script
scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "${scriptDir}/../.." # git repo root
source "$scriptDir/common.sh"

# Use GCP Maven Mirror
mkdir -p "${HOME}/.m2"
cp settings.xml "${HOME}/.m2"

# Publish this repo's modules to local maven to make them available for downstream libraries
mvn install --projects '!gapic-generator-java' \
-Danimal.sniffer.skip \
-Dcheckstyle.skip \
-Dclirr.skip \
-Dfmt.skip \
-DskipTests \
-B -ntp \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS

SHARED_DEPS_VERSION=$(parse_pom_version java-shared-dependencies)

# Run showcase integration tests in GraalVM
pushd showcase/gapic-showcase
SHOWCASE_VERSION=$(mvn help:evaluate -Dexpression=gapic-showcase.version -q -DforceStdout)
popd
# Start showcase server
mkdir -p /usr/src/showcase
curl \
--location https://github.com/googleapis/gapic-showcase/releases/download/v"${SHOWCASE_VERSION}"/gapic-showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz \
--output /usr/src/showcase/showcase-"${SHOWCASE_VERSION}"-linux-amd64.tar.gz
pushd /usr/src/showcase/
tar -xf showcase-*
./gapic-showcase run &
popd

# Run showcase tests with `native` profile
pushd showcase
mvn test -Pnative,-showcase \
-Denforcer.skip=true \
-Dcheckstyle.skip \
-Dfmt.skip \
-ntp -B \
-Dorg.slf4j.simpleLogger.showDateTime=true \
-Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS
popd
Loading

0 comments on commit 0ceb522

Please sign in to comment.