aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTres Seaver <tseaver@palladion.com>2021-08-16 13:16:18 -0400
committerGitHub <noreply@github.com>2021-08-16 13:16:18 -0400
commit5286d6f2bfe78ece3ccbb73c96254800705b0b21 (patch)
tree93b0ab6a16dac36cdef2b76a47fd2c3a5bbb2498
parentb76f151c669325a44ec3741be221e9b6843ea4e4 (diff)
downloadgoogle-auth-library-python-5286d6f2bfe78ece3ccbb73c96254800705b0b21.tar.gz
chore: split systests into separate kokoro build (#833)
* chore: split systests into their own Kokoro build Closes #832. * chore: docs builds no longer need systest resource * chore: remove hacks to get 'gcloud'/'gfile_resource' installed for docs
-rwxr-xr-x.kokoro/build-systests.sh48
-rwxr-xr-x.kokoro/build.sh23
-rw-r--r--.kokoro/docker/docs/Dockerfile8
-rw-r--r--.kokoro/docs/common.cfg5
-rw-r--r--.kokoro/presubmit/system-3.7.cfg5
-rw-r--r--owlbot.py17
6 files changed, 54 insertions, 52 deletions
diff --git a/.kokoro/build-systests.sh b/.kokoro/build-systests.sh
new file mode 100755
index 0000000..a2947c2
--- /dev/null
+++ b/.kokoro/build-systests.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# Copyright 2018 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
+#
+# https://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
+
+if [[ -z "${PROJECT_ROOT:-}" ]]; then
+ PROJECT_ROOT="github/google-auth-library-python"
+fi
+
+cd "${PROJECT_ROOT}"
+
+# Disable buffering, so that the logs stream through.
+export PYTHONUNBUFFERED=1
+
+# Remove old nox
+python3 -m pip uninstall --yes --quiet nox-automation
+
+# Install nox
+python3 -m pip install --upgrade --quiet nox
+python3 -m nox --version
+
+# Setup service account credentials.
+export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
+
+# Setup project id.
+export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt")
+
+# Activate gcloud with service account credentials
+gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
+gcloud config set project ${PROJECT_ID}
+
+# Decrypt system test secrets
+./scripts/decrypt-secrets.sh
+
+# Run system tests which use a different noxfile
+python3 -m nox -f system_tests/noxfile.py
diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 1f96e21..04ab45c 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -24,22 +24,6 @@ cd "${PROJECT_ROOT}"
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
-# Debug: show build environment
-env | grep KOKORO
-
-# Setup service account credentials.
-export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
-
-# Setup project id.
-export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt")
-
-# Activate gcloud with service account credentials
-gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
-gcloud config set project ${PROJECT_ID}
-
-# Decrypt system test secrets
-./scripts/decrypt-secrets.sh
-
# Remove old nox
python3 -m pip uninstall --yes --quiet nox-automation
@@ -54,10 +38,3 @@ if [[ -n "${NOX_SESSION:-}" ]]; then
else
python3 -m nox
fi
-
-
-# Decrypt system test secrets
-./scripts/decrypt-secrets.sh
-
-# Run system tests which use a different noxfile
-python3 -m nox -f system_tests/noxfile.py \ No newline at end of file
diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile
index a6bcfc8..4e1b1fb 100644
--- a/.kokoro/docker/docs/Dockerfile
+++ b/.kokoro/docker/docs/Dockerfile
@@ -64,12 +64,4 @@ RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.8 /tmp/get-pip.py \
&& rm /tmp/get-pip.py
-# Install gcloud SDK
-RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
- tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
- && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
- apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
- && apt-get update -y \
- && apt-get install python2 google-cloud-sdk -y
-
CMD ["python3.8"]
diff --git a/.kokoro/docs/common.cfg b/.kokoro/docs/common.cfg
index 2118d7d..24c8c89 100644
--- a/.kokoro/docs/common.cfg
+++ b/.kokoro/docs/common.cfg
@@ -10,9 +10,6 @@ action {
# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
-# Download resources for system tests (service account key, etc.)
-gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-auth-library-python"
-
# Use the trampoline script to run in docker.
build_file: "google-auth-library-python/.kokoro/trampoline_v2.sh"
@@ -65,4 +62,4 @@ before_action {
keyname: "docuploader_service_account"
}
}
-}
+} \ No newline at end of file
diff --git a/.kokoro/presubmit/system-3.7.cfg b/.kokoro/presubmit/system-3.7.cfg
new file mode 100644
index 0000000..0393b98
--- /dev/null
+++ b/.kokoro/presubmit/system-3.7.cfg
@@ -0,0 +1,5 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+env_vars: {
+ key: "TRAMPOLINE_BUILD_FILE"
+ value: "github/google-auth-library-python/.kokoro/build-systests.sh"
+}
diff --git a/owlbot.py b/owlbot.py
index fa03d69..58aa53a 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -13,7 +13,6 @@ s.move(
templated_files / ".kokoro",
excludes=[
"continuous/common.cfg",
- "docs/common.cfg",
"presubmit/common.cfg",
"build.sh",
],
@@ -26,20 +25,4 @@ assert 1 == s.replace(
'value: "docs"',
)
-assert 1 == s.replace(
- ".kokoro/docker/docs/Dockerfile",
- """\
-CMD \["python3\.8"\]""",
- """\
-# Install gcloud SDK
-RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \\
- tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \\
- && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \\
- apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \\
- && apt-get update -y \\
- && apt-get install python2 google-cloud-sdk -y
-
-CMD ["python3.8"]""",
-)
-
s.shell.run(["nox", "-s", "blacken"], hide_output=False)