Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .kokoro/presubmit/presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ env_vars: {
key: "RUN_SYSTEM_TESTS"
value: "false"
}
env_vars: {
key: "RUN_SNIPPETS_TESTS"
value: "false"
}
7 changes: 7 additions & 0 deletions .kokoro/presubmit/snippets-2.7.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "snippets-2.7"
}
7 changes: 7 additions & 0 deletions .kokoro/presubmit/snippets-3.8.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "snippets-3.8"
}
10 changes: 7 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ def system(session):
def snippets(session):
"""Run the snippets test suite."""

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
# Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.
if os.environ.get("RUN_SNIPPETS_TESTS", "true") == "false":
session.skip("RUN_SNIPPETS_TESTS is set to false, skipping")

# Sanity check: Only run snippets tests if the environment variable is set.
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
session.skip("Credentials must be set via environment variable.")

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

# Install all test dependencies, then install local packages in place.
session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path)
session.install("google-cloud-storage", "-c", constraints_path)
Expand Down