• Home
  • Raw
  • Download

Lines Matching +full:requirements +full:- +full:kokoro

8 #     https://www.apache.org/licenses/LICENSE-2.0
17 # `-e` enables the script to automatically fail when a command fails
18 # `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
19 set -eo pipefail
20 # Enables `**` to include files nested inside sub-folders
21 shopt -s globstar
24 if ! find samples -name 'requirements.txt' | grep -q .; then
25 echo "No tests run. './samples/**/requirements.txt' not found"
33 env | grep KOKORO
36 python3.6 -m pip install --upgrade --quiet nox
39 if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
40 gcloud auth activate-service-account \
41 --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
42 --project="cloud-devrel-kokoro-resources"
46 # - testing/test-env.sh
47 # - testing/service-account.json
48 # - testing/client-secrets.json
49 ./scripts/decrypt-secrets.sh
51 source ./testing/test-env.sh
52 export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json
54 # For cloud-run session, we activate the service account for gcloud sdk.
55 gcloud auth activate-service-account \
56 --key-file "${GOOGLE_APPLICATION_CREDENTIALS}"
58 export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json
60 echo -e "\n******************** TESTING PROJECTS ********************"
64 # Use RTN to return a non-zero value if the test fails.
67 # Find all requirements.txt in the samples directory (may break on whitespace).
68 for file in samples/**/requirements.txt; do
74 echo "------------------------------------------------------------"
75 echo "- testing $file"
76 echo "------------------------------------------------------------"
79 python3.6 -m nox -s "$RUN_TESTS_SESSION"
83 # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
89 if [[ $EXIT -ne 0 ]]; then
91 echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
93 echo -e "\n Testing completed.\n"
99 # Workaround for Kokoro permissions issue: delete secrets
100 rm testing/{test-env.sh,client-secrets.json,service-account.json}