diff --git a/cloudbuild.yaml b/cloudbuild.yaml index c5000e90..88c2ae75 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -15,11 +15,18 @@ timeout: 1800s # 30 minutes steps: - name: gcr.io/cloud-devrel-public-resources/python-multi + id: library entrypoint: /bin/bash args: - - '-c' - - | + - '-c' + - | python3.6 -m pip uninstall --yes --quiet nox-automation && python3.6 -m pip install --upgrade --quiet nox && python3.6 -m nox + - name: gcr.io/cloud-devrel-public-resources/python-multi + id: samples + entrypoint: /bin/bash + args: ['./samples-test-script.sh'] + waitFor: + - library images: - gcr.io/cloud-devrel-public-resources/python-multi diff --git a/samples-test-script.sh b/samples-test-script.sh new file mode 100755 index 00000000..1bbad248 --- /dev/null +++ b/samples-test-script.sh @@ -0,0 +1,10 @@ +export GOOGLE_CLOUD_PROJECT="tz-playground-bigdata" +export GOOGLE_CLOUD_PROJECT_NUMBER=502009289245 +export INSTALL_LIBRARY_FROM_SOURCE=True + +cd ./samples/snippets + +python3.6 -m pip install --quiet nox-automation +python3.6 -m pip install --upgrade --quiet nox +python3.6 -m pip install -r requirements-test.txt +python3.6 -m nox diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 3b87a5c0..e4226bb8 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -85,8 +85,7 @@ def get_pytest_env_vars(): TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) -# TODO: change the default to False when this repo is public. -INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", True)) +INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) # # Style Checks # @@ -198,7 +197,7 @@ def _get_repo_root(): for i in range(10): if p is None: break - if Path(p / ".git").exists(): + if Path(p / ".github").exists(): return str(p) p = p.parent raise Exception("Unable to detect repository root.") diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt new file mode 100644 index 00000000..93f4e9b9 --- /dev/null +++ b/samples/snippets/requirements-test.txt @@ -0,0 +1,2 @@ +backoff==1.10.0 +pytest==5.3.2 \ No newline at end of file