Skip to content

Commit 4e1efad

Browse files
chore: detect samples tests in nested directories (#671)
Source-Link: googleapis/synthtool@50db768 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978
1 parent 6f7386f commit 4e1efad

File tree

13 files changed

+25
-25
lines changed

13 files changed

+25
-25
lines changed

packages/google-cloud-bigtable/.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7
16+
digest: sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978

packages/google-cloud-bigtable/samples/beam/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ def _session_tests(
205205
session: nox.sessions.Session, post_install: Callable = None
206206
) -> None:
207207
# check for presence of tests
208-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
209-
test_list.extend(glob.glob("tests"))
208+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
209+
test_list.extend(glob.glob("**/tests", recursive=True))
210210

211211
if len(test_list) == 0:
212212
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/hello/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/hello_happybase/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/instanceadmin/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/metricscaler/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/quickstart/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/quickstart_happybase/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/snippets/deletes/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

packages/google-cloud-bigtable/samples/snippets/filters/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ def _session_tests(
207207
session: nox.sessions.Session, post_install: Callable = None
208208
) -> None:
209209
# check for presence of tests
210-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
211-
test_list.extend(glob.glob("tests"))
210+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
211+
test_list.extend(glob.glob("**/tests", recursive=True))
212212

213213
if len(test_list) == 0:
214214
print("No tests found, skipping directory.")

0 commit comments

Comments
 (0)