Skip to content

Commit b739596

Browse files
fix: edit presubmit for to simplify configuration (#1915)
* add new presubmit for test purposes * add additional sessions * Update .kokoro/presubmit/presubmit-2.cfg * Update .kokoro/presubmit/presubmit-2.cfg * added timer to nox sessions * Update .kokoro/presubmit/presubmit-2.cfg * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * removes references to most environment variables * testing the use of base names for the nox sessions * removes references to unneeded linting and typing env variables * change file name and update env_vars in presubmit-2 * remove timed decorators * revert several files * Update noxfile.py * remove test, remove unneeded vars, etc --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent a86d7b9 commit b739596

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

.kokoro/presubmit/presubmit.cfg

+2-10
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
# Disable system tests.
44
env_vars: {
5-
key: "RUN_SYSTEM_TESTS"
6-
value: "false"
7-
}
8-
env_vars: {
9-
key: "RUN_SNIPPETS_TESTS"
10-
value: "false"
11-
}
12-
env_vars: {
13-
key: "RUN_LINTING_TYPING_TESTS"
14-
value: "false"
5+
key: "NOX_SESSION"
6+
value: "unit_noextras unit cover docs"
157
}

noxfile.py

-32
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,6 @@ def unit_noextras(session):
132132
def mypy(session):
133133
"""Run type checks with mypy."""
134134

135-
# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
136-
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
137-
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")
138-
139135
session.install("-e", ".[all]")
140136
session.install(MYPY_VERSION)
141137

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

160-
# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
161-
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
162-
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")
163-
164156
session.install("attrs==20.3.0")
165157
session.install("-e", ".[all]")
166158
session.install(PYTYPE_VERSION)
@@ -176,10 +168,6 @@ def system(session):
176168
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
177169
)
178170

179-
# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
180-
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
181-
session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
182-
183171
# Sanity check: Only run system tests if the environment variable is set.
184172
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
185173
session.skip("Credentials must be set via environment variable.")
@@ -224,10 +212,6 @@ def system(session):
224212
def mypy_samples(session):
225213
"""Run type checks with mypy."""
226214

227-
# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
228-
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
229-
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")
230-
231215
session.install("pytest")
232216
for requirements_path in CURRENT_DIRECTORY.glob("samples/*/requirements.txt"):
233217
session.install("-r", str(requirements_path))
@@ -263,10 +247,6 @@ def mypy_samples(session):
263247
def snippets(session):
264248
"""Run the snippets test suite."""
265249

266-
# Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.
267-
if os.environ.get("RUN_SNIPPETS_TESTS", "true") == "false":
268-
session.skip("RUN_SNIPPETS_TESTS is set to false, skipping")
269-
270250
constraints_path = str(
271251
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
272252
)
@@ -409,10 +389,6 @@ def lint(session):
409389
serious code quality issues.
410390
"""
411391

412-
# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
413-
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
414-
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")
415-
416392
session.install("flake8", BLACK_VERSION)
417393
session.install("-e", ".")
418394
session.run("flake8", os.path.join("google", "cloud", "bigquery"))
@@ -427,10 +403,6 @@ def lint(session):
427403
def lint_setup_py(session):
428404
"""Verify that setup.py is valid (including RST check)."""
429405

430-
# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
431-
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
432-
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")
433-
434406
session.install("docutils", "Pygments")
435407
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
436408

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

444-
# Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true.
445-
if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false":
446-
session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping")
447-
448416
session.install(BLACK_VERSION)
449417
session.run("black", *BLACK_PATHS)
450418

0 commit comments

Comments
 (0)