Skip to content

Commit

Permalink
chore: detect samples tests in nested directories (#343)
Browse files Browse the repository at this point in the history
* docs(nodejs_mono_repo): update broken links in README

Source-Link: googleapis/synthtool@50db768
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978

* add pytest requirement for testing

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add pytest-xdist requirement for testing

* remove obsolete files

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Sep 13, 2022
1 parent 0b911fb commit 0b12db8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 351 deletions.
6 changes: 4 additions & 2 deletions generated_samples/interactive-tutorials/events/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ 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.")
Expand Down
310 changes: 0 additions & 310 deletions generated_samples/interactive-tutorials/noxfile.py

This file was deleted.

35 changes: 0 additions & 35 deletions generated_samples/interactive-tutorials/noxfile_config.py

This file was deleted.

6 changes: 4 additions & 2 deletions generated_samples/interactive-tutorials/product/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ 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.")
Expand Down
Empty file.
6 changes: 4 additions & 2 deletions generated_samples/interactive-tutorials/search/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,10 @@ 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.")
Expand Down

0 comments on commit 0b12db8

Please sign in to comment.