From 7b064745567d8d4f8530fecfc8e5ab28c681d595 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Tue, 13 Jul 2021 22:16:51 +0000 Subject: [PATCH 1/4] build: exit early with success when no samples exist --- .kokoro/test-samples-impl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index cf5de74c..5c2771f3 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -20,9 +20,9 @@ set -eo pipefail # Enables `**` to include files nested inside sub-folders shopt -s globstar -# Exit early if samples directory doesn't exist -if [ ! -d "./samples" ]; then - echo "No tests run. `./samples` not found" +# Exit early if samples don't exist +if ! compgen -G "./samples/**/requirements.txt" > /dev/null; then + echo "No tests run. './samples/**/requirements.txt' not found" exit 0 fi From 6c233c9259d7a65aa2dd738fff811f728fc31dff Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Tue, 13 Jul 2021 22:29:09 +0000 Subject: [PATCH 2/4] fix: use find instead --- .kokoro/test-samples-impl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 5c2771f3..311a8d54 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -21,7 +21,7 @@ set -eo pipefail shopt -s globstar # Exit early if samples don't exist -if ! compgen -G "./samples/**/requirements.txt" > /dev/null; then +if ! find samples -name 'requirements.txt' | grep -q .; then echo "No tests run. './samples/**/requirements.txt' not found" exit 0 fi From 744b3fb080700c500bbadcf33d65bd1897d3013a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 13 Jul 2021 22:30:48 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md --- .kokoro/test-samples-impl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d54..cf5de74c 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -20,9 +20,9 @@ set -eo pipefail # Enables `**` to include files nested inside sub-folders shopt -s globstar -# Exit early if samples don't exist -if ! find samples -name 'requirements.txt' | grep -q .; then - echo "No tests run. './samples/**/requirements.txt' not found" +# Exit early if samples directory doesn't exist +if [ ! -d "./samples" ]; then + echo "No tests run. `./samples` not found" exit 0 fi From 9dcf6471fd668492b54bb728cd120d9993874bc1 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Tue, 13 Jul 2021 22:31:42 +0000 Subject: [PATCH 4/4] chore: undo owlbot --- .kokoro/test-samples-impl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index cf5de74c..311a8d54 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -20,9 +20,9 @@ set -eo pipefail # Enables `**` to include files nested inside sub-folders shopt -s globstar -# Exit early if samples directory doesn't exist -if [ ! -d "./samples" ]; then - echo "No tests run. `./samples` not found" +# Exit early if samples don't exist +if ! find samples -name 'requirements.txt' | grep -q .; then + echo "No tests run. './samples/**/requirements.txt' not found" exit 0 fi