1515
1616set -eo pipefail
1717
18+ CURRENT_DIR=$( dirname " ${BASH_SOURCE[0]} " )
19+
1820if [[ -z " ${PROJECT_ROOT:- } " ]]; then
19- PROJECT_ROOT=" github/python-ndb "
21+ PROJECT_ROOT=$( realpath " ${CURRENT_DIR} /.. " )
2022fi
2123
22- cd " ${PROJECT_ROOT} "
24+ pushd " ${PROJECT_ROOT} "
2325
2426# Disable buffering, so that the logs stream through.
2527export PYTHONUNBUFFERED=1
2628
2729# Debug: show build environment
2830env | grep KOKORO
2931
30- if [[ -f " ${KOKORO_GFILE_DIR} /service-account.json" ]]; then
31- # Setup service account credentials.
32+ # Setup service account credentials.
33+ if [[ -f " ${KOKORO_GFILE_DIR} /service-account.json" ]]
34+ then
3235 export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR} /service-account.json
3336fi
3437
3538# Setup project id.
36- export PROJECT_ID=$( cat " ${KOKORO_GFILE_DIR} /project-id.json" )
39+ if [[ -f " ${KOKORO_GFILE_DIR} /project-id.json" ]]
40+ then
41+ export PROJECT_ID=$( cat " ${KOKORO_GFILE_DIR} /project-id.json" )
3742
3843if [[ -f " ${KOKORO_GFILE_DIR} /service-account.json" ]]; then
3944 # Configure local Redis to be used
@@ -49,6 +54,7 @@ if [[ -f "${KOKORO_GFILE_DIR}/service-account.json" ]]; then
4954 gcloud --quiet --verbosity=debug datastore indexes create tests/system/index.yaml
5055fi
5156
57+ fi
5258
5359# If this is a continuous build, send the test log to the FlakyBot.
5460# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
6369# If NOX_SESSION is set, it only runs the specified session,
6470# otherwise run all the sessions.
6571if [[ -n " ${NOX_SESSION:- } " ]]; then
66- python3 -m nox -s ${NOX_SESSION:- }
72+ python3 -m nox -s ${NOX_SESSION:- }
6773else
68- python3 -m nox
74+ python3 -m nox
6975fi
0 commit comments