Skip to content

Commit ac49177

Browse files
authored
Consolidate Kokoro tests by python language. (#2582)
* Add Kokoro build configs for condensed job configs. * Add default to base noxfile. * Rename env_var for specifying sessions to avoid conflict with nox-scoped items. * Give script for Kokoro to run. * Make tests executable. * Move cd higher in the script. * Download latest version of Cloud SQL proxy. * CURRENT YEAR * Use local proxy. * Direct proxy output to logs. * Make change to trigger lint fail. * Correctly invert noxfile check. * Even more quiet proxy. * Update noxfile. * Fix linting error sin cloud-sql/mysql * Fix typo. * Fix py2 session name. * Add debugging line. * More debugging. * Debug env_var. * Remove debugging. * Reset session names. * Use the cool python containers. * Install our own nox. * Remove testing requirement.
1 parent 980c64e commit ac49177

File tree

16 files changed

+467
-48
lines changed

16 files changed

+467
-48
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ credentials.dat
2626
*sponge_log.xml
2727
.DS_store
2828
env/
29+
.idea

.kokoro/lint/common.cfg

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Configure the docker image for kokoro-trampoline.
18+
env_vars: {
19+
key: "TRAMPOLINE_IMAGE"
20+
value: "gcr.io/cloud-devrel-kokoro-resources/python"
21+
}
22+
23+
# Download trampoline resources.
24+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
25+
26+
# Use the trampoline script to run in docker.
27+
build_file: "python-docs-samples/.kokoro/trampoline.sh"
28+
29+
# Download secrets from Cloud Storage.
30+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
31+
32+
# Copy results for Resultstore
33+
action {
34+
define_artifacts {
35+
regex: "**/*sponge_log.xml"
36+
}
37+
}
38+
39+
# Specify which tests to run
40+
env_vars: {
41+
key: "RUN_TESTS_SESSION"
42+
value: "lint"
43+
}

.kokoro/lint/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/python-docs-samples/.kokoro/tests/run_tests_only_diff.sh"
21+
}

.kokoro/python2.7/common.cfg

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Configure the docker image for kokoro-trampoline.
18+
env_vars: {
19+
key: "TRAMPOLINE_IMAGE"
20+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
21+
}
22+
23+
# Download trampoline resources.
24+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
25+
26+
# Use the trampoline script to run in docker.
27+
build_file: "python-docs-samples/.kokoro/trampoline.sh"
28+
29+
# Download secrets from Cloud Storage.
30+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
31+
32+
# Copy results for Resultstore
33+
action {
34+
define_artifacts {
35+
regex: "**/*sponge_log.xml"
36+
}
37+
}
38+
39+
# Specify which tests to run
40+
env_vars: {
41+
key: "RUN_TESTS_SESSION"
42+
value: "py2-2.7"
43+
}

.kokoro/python2.7/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/python-docs-samples/.kokoro/tests/run_tests_only_diff.sh"
21+
}

.kokoro/python3.5/common.cfg

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Configure the docker image for kokoro-trampoline.
18+
env_vars: {
19+
key: "TRAMPOLINE_IMAGE"
20+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
21+
}
22+
23+
# Download trampoline resources.
24+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
25+
26+
# Use the trampoline script to run in docker.
27+
build_file: "python-docs-samples/.kokoro/trampoline.sh"
28+
29+
# Download secrets from Cloud Storage.
30+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
31+
32+
# Copy results for Resultstore
33+
action {
34+
define_artifacts {
35+
regex: "**/*sponge_log.xml"
36+
}
37+
}
38+
39+
# Specify which tests to run
40+
env_vars: {
41+
key: "RUN_TESTS_SESSION"
42+
value: "py3-3.5"
43+
}

.kokoro/python3.5/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/python-docs-samples/.kokoro/tests/run_tests_only_diff.sh"
21+
}

.kokoro/python3.6/common.cfg

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Configure the docker image for kokoro-trampoline.
18+
env_vars: {
19+
key: "TRAMPOLINE_IMAGE"
20+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
21+
}
22+
23+
# Download trampoline resources.
24+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
25+
26+
# Use the trampoline script to run in docker.
27+
build_file: "python-docs-samples/.kokoro/trampoline.sh"
28+
29+
# Download secrets from Cloud Storage.
30+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
31+
32+
# Copy results for Resultstore
33+
action {
34+
define_artifacts {
35+
regex: "**/*sponge_log.xml"
36+
}
37+
}
38+
39+
# Specify which tests to run
40+
env_vars: {
41+
key: "RUN_TESTS_SESSION"
42+
value: "py3-3.6"
43+
}

.kokoro/python3.6/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/python-docs-samples/.kokoro/tests/run_tests_only_diff.sh"
21+
}

.kokoro/python3.7/common.cfg

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
# Configure the docker image for kokoro-trampoline.
18+
env_vars: {
19+
key: "TRAMPOLINE_IMAGE"
20+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
21+
}
22+
23+
# Download trampoline resources.
24+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
25+
26+
# Use the trampoline script to run in docker.
27+
build_file: "python-docs-samples/.kokoro/trampoline.sh"
28+
29+
# Download secrets from Cloud Storage.
30+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
31+
32+
# Copy results for Resultstore
33+
action {
34+
define_artifacts {
35+
regex: "**/*sponge_log.xml"
36+
}
37+
}
38+
39+
# Specify which tests to run
40+
env_vars: {
41+
key: "RUN_TESTS_SESSION"
42+
value: "py3-3.7"
43+
}

.kokoro/python3.7/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/python-docs-samples/.kokoro/tests/run_tests_only_diff.sh"
21+
}

0 commit comments

Comments
 (0)