Skip to content

Commit 3382cee

Browse files
authored
chore: add downstream check for native image tests in cloud build (#715)
* chore: add dowsntream check for native image tests in cloud build
1 parent b22a75a commit 3382cee

3 files changed

Lines changed: 41 additions & 35 deletions

File tree

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ timeout: 7200s # 2 hours
1616
substitutions:
1717
_JAVA_SHARED_CONFIG_VERSION: '1.7.0' # {x-version-update:google-cloud-shared-config:released}
1818
_GRAALVM_A: 'graalvm22_3_jdk11'
19-
_GRAALVM_B: 'graalvm22_3_jdk17'
19+
2020
steps:
2121
# GraalVM A build
2222
- name: gcr.io/cloud-builders/docker
@@ -28,15 +28,8 @@ steps:
2828
args:
2929
["-i", "gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/${_GRAALVM_A}.yaml", "-v"]
3030
waitFor: ["graalvm-a-build"]
31+
- name: gcr.io/cloud-devrel-public-resources/graalvm_a:${_JAVA_SHARED_CONFIG_VERSION}
32+
entrypoint: bash
33+
args: [ './.kokoro/presubmit/downstream-build.sh' ]
34+
waitFor: [ "graalvm-a-build" ]
3135

32-
33-
# GraalVM B build
34-
- name: gcr.io/cloud-builders/docker
35-
args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "${_GRAALVM_B}.Dockerfile", "."]
36-
dir: .cloudbuild
37-
id: graalvm-b-build
38-
waitFor: ["-"]
39-
- name: gcr.io/gcp-runtimes/structure_test
40-
args:
41-
["-i", "gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/${_GRAALVM_B}.yaml", "-v"]
42-
waitFor: ["graalvm-b-build"]

.cloudbuild/cloudbuild-test-b.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
timeout: 7200s # 2 hours
16+
substitutions:
17+
_JAVA_SHARED_CONFIG_VERSION: '1.7.0' # {x-version-update:google-cloud-shared-config:released}
18+
_GRAALVM_B: 'graalvm22_3_jdk17'
19+
20+
steps:
21+
# GraalVM B build
22+
- name: gcr.io/cloud-builders/docker
23+
args: ["build", "-t", "gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--file", "${_GRAALVM_B}.Dockerfile", "."]
24+
dir: .cloudbuild
25+
id: graalvm-b-build
26+
waitFor: ["-"]
27+
- name: gcr.io/gcp-runtimes/structure_test
28+
args:
29+
["-i", "gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}", "--config", ".cloudbuild/${_GRAALVM_B}.yaml", "-v"]
30+
waitFor: ["graalvm-b-build"]
31+
- name: gcr.io/cloud-devrel-public-resources/graalvm_b:${_JAVA_SHARED_CONFIG_VERSION}
32+
entrypoint: bash
33+
args: [ './.kokoro/presubmit/downstream-build.sh' ]
34+
waitFor: [ "graalvm-b-build" ]

.kokoro/presubmit/downstream-build.sh

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515

1616
set -eo pipefail
17+
set -x
1718

1819

1920
function modify_shared_config() {
@@ -26,18 +27,13 @@ function modify_shared_config() {
2627
EOF
2728
}
2829

29-
if [ -z "${MODULES_UNDER_TEST}" ]; then
30-
echo "MODULES_UNDER_TEST must be set to run downstream-build.sh"
31-
exit 1
32-
fi
33-
3430
### Round 1
3531
## Get the directory of the build script and install java-shared-config
3632
scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
3733
## cd to the parent directory, i.e. the root of the git repo
3834
cd "${scriptDir}/../.."
3935
mvn -B -ntp install -Dcheckstyle.skip -Dfmt.skip -DskipTests
40-
SHARED_CONFIG_VERSION=$(sed -e 's/xmlns=".*"//' pom.xml | xmllint --xpath '/project/version/text()' -)
36+
SHARED_CONFIG_VERSION=$(sed -e 's/xmlns=".*"//' java-shared-config/pom.xml | xmllint --xpath '/project/version/text()' -)
4137

4238
# Use GCP Maven Mirror
4339
mkdir -p "${HOME}/.m2"
@@ -71,21 +67,4 @@ pushd sdk-platform-java/showcase
7167
mvn test -Pnative,-showcase -Denforcer.skip=true -ntp -B
7268
popd
7369

74-
75-
### Round 3
76-
# Update the shared-config version in google-cloud-jar-parent
77-
git clone "https://github.com/googleapis/google-cloud-java.git" --depth=1
78-
pushd google-cloud-java/google-cloud-pom-parent
79-
modify_shared_config
80-
popd
81-
82-
# Run the updated java-shared-config against google-cloud-java
83-
pushd google-cloud-java
84-
source ./.kokoro/common.sh
85-
RETURN_CODE=0
86-
setup_application_credentials
87-
setup_cloud "$MODULES_UNDER_TEST"
88-
run_graalvm_tests "$MODULES_UNDER_TEST"
89-
90-
9170
exit $RETURN_CODE

0 commit comments

Comments
 (0)