From ea80d1cac8ab8456e764d8d1b2bedeaeebb757d4 Mon Sep 17 00:00:00 2001 From: Joe Wang <106995533+JoeWang1127@users.noreply.github.com> Date: Thu, 9 May 2024 12:39:32 -0400 Subject: [PATCH 1/2] chore: remove unused CLIs (#2677) In this PR: - Remove CLI in `generate_repo.py` and `generate_pr_description.py` since these CLIs are migrated to `entry_point.py`. --- .../cli/generate_monorepo_gapic_bom.py | 1 - library_generation/generate_pr_description.py | 49 +------------ library_generation/generate_repo.py | 72 +------------------ 3 files changed, 2 insertions(+), 120 deletions(-) diff --git a/library_generation/cli/generate_monorepo_gapic_bom.py b/library_generation/cli/generate_monorepo_gapic_bom.py index 999c9e5ebf..b26a02c17f 100644 --- a/library_generation/cli/generate_monorepo_gapic_bom.py +++ b/library_generation/cli/generate_monorepo_gapic_bom.py @@ -14,7 +14,6 @@ import click as click from library_generation.utils.pom_generator import generate_gapic_bom -from library_generation.utils.pom_generator import generate_root_pom @click.group(invoke_without_command=False) diff --git a/library_generation/generate_pr_description.py b/library_generation/generate_pr_description.py index 042d0bf59d..a223a8f88d 100644 --- a/library_generation/generate_pr_description.py +++ b/library_generation/generate_pr_description.py @@ -15,57 +15,14 @@ import calendar import os import shutil -import click as click from typing import Dict from git import Commit, Repo -from library_generation.model.generation_config import GenerationConfig, from_yaml +from library_generation.model.generation_config import GenerationConfig from library_generation.utils.proto_path_utils import find_versioned_proto_path from library_generation.utils.commit_message_formatter import format_commit_message from library_generation.utils.commit_message_formatter import wrap_override_commit -@click.group(invoke_without_command=False) -@click.pass_context -@click.version_option(message="%(version)s") -def main(ctx): - pass - - -@main.command() -@click.option( - "--generation-config-yaml", - required=True, - type=str, - help=""" - Path to generation_config.yaml that contains the metadata about - library generation. - The googleapis commit in the configuration is the latest commit, - inclusively, from which the commit message is considered. - """, -) -@click.option( - "--baseline-commit", - required=True, - type=str, - help=""" - The baseline (oldest) commit, exclusively, from which the commit message is - considered. - This commit should be an ancestor of googleapis commit in configuration. - """, -) -def generate( - generation_config_yaml: str, - baseline_commit: str, -) -> None: - idx = generation_config_yaml.rfind("/") - config_path = generation_config_yaml[:idx] - generate_pr_descriptions( - config=from_yaml(generation_config_yaml), - baseline_commit=baseline_commit, - description_path=config_path, - ) - - def generate_pr_descriptions( config: GenerationConfig, baseline_commit: str, @@ -218,7 +175,3 @@ def __get_commit_timestamp(commit: Commit) -> int: :return: the timestamp of the commit """ return calendar.timegm(commit.committed_datetime.utctimetuple()) - - -if __name__ == "__main__": - main() diff --git a/library_generation/generate_repo.py b/library_generation/generate_repo.py index 9a97e3555b..af70bcc1f2 100755 --- a/library_generation/generate_repo.py +++ b/library_generation/generate_repo.py @@ -12,79 +12,13 @@ # 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. -import click as click import library_generation.utils.utilities as util from library_generation.generate_composed_library import generate_composed_library -from library_generation.model.generation_config import GenerationConfig, from_yaml +from library_generation.model.generation_config import GenerationConfig from library_generation.model.library_config import LibraryConfig from library_generation.utils.monorepo_postprocessor import monorepo_postprocessing -@click.group(invoke_without_command=False) -@click.pass_context -@click.version_option(message="%(version)s") -def main(ctx): - pass - - -@main.command() -@click.option( - "--generation-config-yaml", - required=True, - type=str, - help=""" - Path to generation_config.yaml that contains the metadata about - library generation - """, -) -@click.option( - "--target-library-names", - required=False, - default=None, - type=str, - help=""" - A list of libraries will be generated. - - If specified, only the `library` whose library_name is in - target-library-names will be generated. - If not specified, all libraries in the configuration yaml will be generated. - - The input string will be parsed to a list of string with comma as the - separator. - - For example, apigeeconnect,alloydb-connectors will be parsed as a - list of two strings, apigeeconnect and alloydb-connectors. - """, -) -@click.option( - "--repository-path", - required=False, - default=".", - type=str, - help=""" - If specified, the generated files will be sent to this location. - If not specified, the repository will be generated to the current working - directory. - """, -) -def generate( - generation_config_yaml: str, - target_library_names: str, - repository_path: str, -): - config = from_yaml(generation_config_yaml) - generate_from_yaml( - config_path=generation_config_yaml, - config=config, - repository_path=repository_path, - target_library_names=( - target_library_names.split(",") - if target_library_names is not None - else target_library_names - ), - ) - - def generate_from_yaml( config_path: str, config: GenerationConfig, @@ -152,7 +86,3 @@ def get_target_libraries( for library in config.libraries if library.get_library_name() in target_libraries ] - - -if __name__ == "__main__": - main() From 69f5aecbb7d615eddf38ef236a944800edb8d731 Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Thu, 9 May 2024 15:57:47 -0400 Subject: [PATCH 2/2] ci: parallelize downstream and showcase native testing (#2749) --- .../cloudbuild-test-a-downstream-kms.yaml | 46 ++++++++++++++ ...dbuild-test-a-downstream-kmsinventory.yaml | 46 ++++++++++++++ .cloudbuild/graalvm/cloudbuild-test-a.yaml | 13 ++-- .../cloudbuild-test-b-downstream-kms.yaml | 45 +++++++++++++ ...dbuild-test-b-downstream-kmsinventory.yaml | 46 ++++++++++++++ .cloudbuild/graalvm/cloudbuild-test-b.yaml | 13 ++-- .kokoro/presubmit/common.cfg | 33 ---------- .kokoro/presubmit/downstream-build.sh | 35 +---------- .kokoro/presubmit/showcase-native.sh | 63 +++++++++++++++++++ 9 files changed, 267 insertions(+), 73 deletions(-) create mode 100644 .cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml create mode 100644 .cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml create mode 100644 .cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml create mode 100644 .cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml delete mode 100644 .kokoro/presubmit/common.cfg create mode 100644 .kokoro/presubmit/showcase-native.sh diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml new file mode 100644 index 0000000000..831b72f674 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml @@ -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' diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml new file mode 100644 index 0000000000..73b1e91713 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml @@ -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' diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index 3b7f864812..1e94185f51 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -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 \ No newline at end of file diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml new file mode 100644 index 0000000000..5bcb9e1517 --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml @@ -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' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml new file mode 100644 index 0000000000..5a007ce67b --- /dev/null +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml @@ -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' diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index 71ad6cc1da..79bddcb824 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -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 \ No newline at end of file diff --git a/.kokoro/presubmit/common.cfg b/.kokoro/presubmit/common.cfg deleted file mode 100644 index 24deaae512..0000000000 --- a/.kokoro/presubmit/common.cfg +++ /dev/null @@ -1,33 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# All builds use the trampoline script to run in docker. -build_file: "sdk-platform-java/.kokoro/trampoline.sh" - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/sdk-platform-java/.kokoro/presubmit/downstream-build.sh" -} - -# TODO: remove this after we've migrated all tests and scripts -env_vars: { - key: "GCLOUD_PROJECT" - value: "cloud-java-ci-test" -} - -env_vars: { - key: "GOOGLE_CLOUD_PROJECT" - value: "cloud-java-ci-test" -} - -env_vars: { - key: "GOOGLE_APPLICATION_CREDENTIALS" - value: "secret_manager/cloud-java-ci-it-service-account" -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "cloud-java-ci-it-service-account" -} \ No newline at end of file diff --git a/.kokoro/presubmit/downstream-build.sh b/.kokoro/presubmit/downstream-build.sh index 4b0e9418df..274ec58d5c 100755 --- a/.kokoro/presubmit/downstream-build.sh +++ b/.kokoro/presubmit/downstream-build.sh @@ -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]}")") @@ -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 \ @@ -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" diff --git a/.kokoro/presubmit/showcase-native.sh b/.kokoro/presubmit/showcase-native.sh new file mode 100644 index 0000000000..4cd9fd6090 --- /dev/null +++ b/.kokoro/presubmit/showcase-native.sh @@ -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