Skip to content

run/ GOOGLE_CLOUD_PROJECT required for running tests #646

@grant

Description

@grant

run/helloworld test instructions are missing a step for e2e tests.

Repro:

Clone repo and follow instructions here:
https://github.com/GoogleCloudPlatform/ruby-docs-samples/tree/master/run/helloworld

bundle exec rspec fails if you follow the instructions verbatim and don't set GOOGLE_CLOUD_PROJECT first.

Full error is misleading as gcloud config set project PROJECT_ID doesn't work:

 bundle exec rspec
ERROR: (gcloud.builds.submit) The project property is set to the empty string, which is invalid.
To set your project, run:

  $ gcloud config set project PROJECT_ID

or to unset it, run:

  $ gcloud config unset project
ERROR: (gcloud.run.services.describe) The project property is set to the empty string, which is invalid.
To set your project, run:

  $ gcloud config set project PROJECT_ID

or to unset it, run:

  $ gcloud config unset project
FERROR: (gcloud.run.services.delete) The project property is set to the empty string, which is invalid.
To set your project, run:

  $ gcloud config set project PROJECT_ID

or to unset it, run:

  $ gcloud config unset project
..

Failures:

  1) E2E tests Can make request to service
     Failure/Error: raise "Error: No service url found. For example: https://service-x8xabcdefg-uc.a.run.app"
     
     RuntimeError:
       Error: No service url found. For example: https://service-x8xabcdefg-uc.a.run.app
     # ./spec/e2e_spec.rb:47:in `block (2 levels) in <top (required)>'

Finished in 2.14 seconds (files took 0.44361 seconds to load)
3 examples, 1 failure

Failed examples:

rspec ./spec/e2e_spec.rb:68 # E2E tests Can make request to service


Also seeing this error:

...
Step #2: a36eef698b0d: Pull complete
Step #2: Digest: sha256:ca8aa5f80373f7b4b66abcb2ab21f47f2a115d3b0179f15a0dacefc3d2f1c3f4
Step #2: Status: Downloaded newer image for gcr.io/google.com/cloudsdktool/cloud-sdk:latest
Step #2: gcr.io/google.com/cloudsdktool/cloud-sdk:latest
Step #2: ERROR: (gcloud.run.deploy) PERMISSION_DENIED: The caller does not have permission
Finished Step #2

I don't think I have permissions for project cloudsdktool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: runIssues related to the Cloud Run API.priority: p2Moderately-important priority. Fix may not be included in next release.samplesIssues that are directly related to samples.type: docsImprovement to the documentation for an API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions