From 251b16381de2b771d9d042b23529f55e4d36a1ef Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 12:31:52 -0400 Subject: [PATCH] chore: detect samples tests in nested directories (#442) Source-Link: https://github.com/googleapis/synthtool/commit/50db768f450a50d7c1fd62513c113c9bb96fd434 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978 Co-authored-by: Owl Bot --- packages/google-cloud-speech/.github/.OwlBot.lock.yaml | 2 +- packages/google-cloud-speech/samples/microphone/noxfile.py | 4 ++-- packages/google-cloud-speech/samples/snippets/noxfile.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-speech/.github/.OwlBot.lock.yaml b/packages/google-cloud-speech/.github/.OwlBot.lock.yaml index b8dcb4a4af99..aa547962eb0a 100644 --- a/packages/google-cloud-speech/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-speech/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7 + digest: sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978 diff --git a/packages/google-cloud-speech/samples/microphone/noxfile.py b/packages/google-cloud-speech/samples/microphone/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/packages/google-cloud-speech/samples/microphone/noxfile.py +++ b/packages/google-cloud-speech/samples/microphone/noxfile.py @@ -207,8 +207,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("*_test.py") + glob.glob("test_*.py") - test_list.extend(glob.glob("tests")) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: print("No tests found, skipping directory.") diff --git a/packages/google-cloud-speech/samples/snippets/noxfile.py b/packages/google-cloud-speech/samples/snippets/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/packages/google-cloud-speech/samples/snippets/noxfile.py +++ b/packages/google-cloud-speech/samples/snippets/noxfile.py @@ -207,8 +207,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("*_test.py") + glob.glob("test_*.py") - test_list.extend(glob.glob("tests")) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: print("No tests found, skipping directory.")