Skip to content

Commit 9c6c297

Browse files
committed
Merge remote-tracking branch 'origin/language' into language
2 parents 9f029c1 + a057aae commit 9c6c297

File tree

11 files changed

+171
-21
lines changed

11 files changed

+171
-21
lines changed

.kokoro/common.cfg renamed to .kokoro/java11/common.cfg

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017 Google Inc.
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -17,21 +17,26 @@
1717
# Download secrets from Cloud Storage.
1818
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples"
1919

20-
# Download trampoline resources.
20+
# Download trampoline resources.
2121
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
2222

2323
# Use the trampoline script to run in docker.
2424
build_file: "java-docs-samples/.kokoro/trampoline.sh"
2525

26-
# Configure the docker image for kokoro-trampoline.
27-
env_vars: {
28-
key: "TRAMPOLINE_IMAGE"
29-
value: "gcr.io/cloud-devrel-kokoro-resources/java"
30-
}
31-
3226
action {
3327
define_artifacts {
3428
regex: "**/*sponge_log.xml"
3529
}
3630
}
3731

32+
# Set the JAVA VERSION env var.
33+
env_vars: {
34+
key: "JAVA_VERSION"
35+
value: "11"
36+
}
37+
38+
# Configure the docker image for kokoro-trampoline.
39+
env_vars: {
40+
key: "TRAMPOLINE_IMAGE"
41+
value: "gcr.io/cloud-devrel-kokoro-resources/java11"
42+
}

.kokoro/java11/continuous.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2019 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+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which tests to run.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: "github/java-docs-samples/.kokoro/tests/run_tests.sh"
21+
}

.kokoro/java11/periodic.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2019 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+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: "github/java-docs-samples/.kokoro/tests/run_tests.sh"
21+
}

.kokoro/presubmit.cfg renamed to .kokoro/java11/presubmit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017 Google Inc.
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.kokoro/java8/common.cfg

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2019 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+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Download secrets from Cloud Storage.
18+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/java-docs-samples"
19+
20+
# Download trampoline resources.
21+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
22+
23+
# Use the trampoline script to run in docker.
24+
build_file: "java-docs-samples/.kokoro/trampoline.sh"
25+
26+
action {
27+
define_artifacts {
28+
regex: "**/*sponge_log.xml"
29+
}
30+
}
31+
32+
# Set the JAVA VERSION env var.
33+
env_vars: {
34+
key: "JAVA_VERSION"
35+
value: "1.8"
36+
}
37+
38+
# Configure the docker image for kokoro-trampoline.
39+
env_vars: {
40+
key: "TRAMPOLINE_IMAGE"
41+
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
42+
}

.kokoro/continuous.cfg renamed to .kokoro/java8/continuous.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017 Google Inc.
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.kokoro/periodic.cfg renamed to .kokoro/java8/periodic.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2017 Google Inc.
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.kokoro/java8/presubmit.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2019 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+
# Format: //devtools/kokoro/config/proto/build.proto
16+
17+
# Tell the trampoline which build file to use.
18+
env_vars: {
19+
key: "TRAMPOLINE_BUILD_FILE"
20+
value: "github/java-docs-samples/.kokoro/tests/diff_tests.sh"
21+
}

.kokoro/tests/diff_tests.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ for file in **/pom.xml; do
5252
# Only tests changed projects
5353
git diff --quiet master.. .
5454
CHANGED=$?
55+
5556
# Only test leafs to prevent testing twice
5657
PARENT=$(grep "<modules>" pom.xml -c)
5758

59+
# Get the Java version from the pom.xml
60+
VERSION=$(grep -oP '(?<=<maven.compiler.target>).*?(?=</maven.compiler.target>)' pom.xml)
61+
5862
# Check for changes to the current folder
59-
if [ "$CHANGED" -eq 1 ] && [ "$PARENT" -eq 0 ]; then
63+
if [ "$CHANGED" -eq 1 ] && [ "$PARENT" -eq 0 ] && [ ",$JAVA_VERSIONS," = *",$VERSION,"* ]; then
6064
echo "------------------------------------------------------------"
6165
echo "- testing $file"
6266
echo "------------------------------------------------------------"
@@ -69,7 +73,7 @@ for file in **/pom.xml; do
6973
-Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \
7074
-Dbigtable.instanceID=instance
7175
EXIT=$?
72-
76+
7377
if [ $EXIT -ne 0 ]; then
7478
echo -e "\n Tests failed. \n"
7579
RESULT=1

.kokoro/tests/run_tests.sh

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,47 @@ gcloud auth activate-service-account\
3838
--key-file=$GOOGLE_APPLICATION_CREDENTIALS \
3939
--project=$GOOGLE_CLOUD_PROJECT
4040

41-
# Run the tests
41+
echo -e "\n******************** TESTING AFFECTED PROJECTS ********************"
42+
set +e
43+
RESULT=0
4244
cd github/java-docs-samples
43-
mvn --batch-mode --fail-at-end clean verify \
44-
-Dfile.encoding="UTF-8" \
45-
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
46-
-Dmaven.test.redirectTestOutputToFile=true \
47-
-Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \
48-
-Dbigtable.instanceID=instance
45+
# For every pom.xml (may break on whitespace)
46+
for file in **/pom.xml; do
47+
# Navigate to project
48+
file=$(dirname "$file")
49+
pushd "$file" > /dev/null
50+
51+
# Only test leafs to prevent testing twice
52+
PARENT=$(grep "<modules>" pom.xml -c)
53+
54+
# Get the Java version from the pom.xml
55+
VERSION=$(grep -oP '(?<=<maven.compiler.target>).*?(?=</maven.compiler.target>)' pom.xml)
56+
57+
# Check for changes to the current folder
58+
if [ "$PARENT" -eq 0 ] && [ ",$JAVA_VERSIONS," = *",$VERSION,"* ]; then
59+
echo "------------------------------------------------------------"
60+
echo "- testing $file"
61+
echo "------------------------------------------------------------"
62+
63+
# Run tests and update RESULT if failed
64+
mvn -q --batch-mode --fail-at-end clean verify \
65+
-Dfile.encoding="UTF-8" \
66+
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
67+
-Dmaven.test.redirectTestOutputToFile=true \
68+
-Dbigtable.projectID="${GOOGLE_CLOUD_PROJECT}" \
69+
-Dbigtable.instanceID=instance
70+
EXIT=$?
71+
72+
if [ $EXIT -ne 0 ]; then
73+
echo -e "\n Tests failed. \n"
74+
RESULT=1
75+
else
76+
echo -e "\n Tests complete. \n"
77+
fi
78+
fi
79+
80+
popd > /dev/null
81+
82+
done
83+
84+
exit $RESULT

opencensus/src/main/java/com/example/opencensus/Quickstart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.util.concurrent.TimeUnit;
3737

3838
public class Quickstart {
39-
private static final int EXPORT_INTERVAL = 60;
39+
private static final int EXPORT_INTERVAL = 70;
4040
private static final MeasureLong LATENCY_MS = MeasureLong.create(
4141
"task_latency",
4242
"The task latency in milliseconds",

0 commit comments

Comments
 (0)