Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: edit presubmit for to simplify configuration #1915

Merged
merged 18 commits into from
May 15, 2024
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
12 changes: 2 additions & 10 deletions .kokoro/presubmit/presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

# Disable system tests.
env_vars: {
key: "RUN_SYSTEM_TESTS"
value: "false"
}
env_vars: {
key: "RUN_SNIPPETS_TESTS"
value: "false"
}
env_vars: {
key: "RUN_LINTING_TYPING_TESTS"
value: "false"
key: "NOX_SESSION"
value: "unit_noextras unit cover docs"
}
32 changes: 0 additions & 32 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ def unit_noextras(session):
def mypy(session):
"""Run type checks with mypy."""

# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")

session.install("-e", ".[all]")
session.install(MYPY_VERSION)

Expand All @@ -157,10 +153,6 @@ def pytype(session):
# recent version avoids the error until a possibly better fix is found.
# https://github.com/googleapis/python-bigquery/issues/655

# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")

session.install("attrs==20.3.0")
session.install("-e", ".[all]")
session.install(PYTYPE_VERSION)
Expand All @@ -176,10 +168,6 @@ def system(session):
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)

# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
session.skip("RUN_SYSTEM_TESTS is set to false, skipping")

# Sanity check: Only run system tests if the environment variable is set.
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
session.skip("Credentials must be set via environment variable.")
Expand Down Expand Up @@ -224,10 +212,6 @@ def system(session):
def mypy_samples(session):
"""Run type checks with mypy."""

# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")

session.install("pytest")
for requirements_path in CURRENT_DIRECTORY.glob("samples/*/requirements.txt"):
session.install("-r", str(requirements_path))
Expand Down Expand Up @@ -263,10 +247,6 @@ def mypy_samples(session):
def snippets(session):
"""Run the snippets test suite."""

# 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")

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
Expand Down Expand Up @@ -409,10 +389,6 @@ def lint(session):
serious code quality issues.
"""

# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")

session.install("flake8", BLACK_VERSION)
session.install("-e", ".")
session.run("flake8", os.path.join("google", "cloud", "bigquery"))
Expand All @@ -427,10 +403,6 @@ def lint(session):
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""

# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")

session.install("docutils", "Pygments")
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")

Expand All @@ -441,10 +413,6 @@ def blacken(session):
Format code to uniform standard.
"""

# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")

session.install(BLACK_VERSION)
session.run("black", *BLACK_PATHS)

Expand Down