Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: need a decision on how to deal with project IDs in tests #128

Closed
cflewis opened this issue Jun 22, 2018 · 2 comments
Closed

all: need a decision on how to deal with project IDs in tests #128

cflewis opened this issue Jun 22, 2018 · 2 comments
Assignees
Labels
bug Something isn't working code health Code health task, either refactoring or testing
Milestone

Comments

@cflewis
Copy link
Contributor

cflewis commented Jun 22, 2018

AWS tests don't require project IDs, nor most GCP ones, as they use the default project set in aws or gcloud. runtimevar actually does, because it to build URLs that use that project ID.

@zombiezen thinks the best thing to do is to force flags to be passed to all of them to avoid magic, although this might break vgo test ./... (not that I've been able to make it work TBH, I always cd to where I want to test from). I see the point here, but the practical downside is problematic.

The other option is for tests that do need them to shell out to gcloud (no programmatic way due to golang/oauth2#241).

@cflewis cflewis added bug Something isn't working needs info Further discussion or clarification is necessary code health Code health task, either refactoring or testing labels Jun 22, 2018
@cflewis cflewis added this to the Sprint 14 milestone Jun 22, 2018
@zombiezen zombiezen changed the title Need a decision on how to deal with project IDs all: need a decision on how to deal with project IDs in tests Jun 22, 2018
@zombiezen zombiezen removed this from the Sprint 14 milestone Jul 9, 2018
@cflewis cflewis added this to the Unplanned milestone Jul 9, 2018
@ijt
Copy link
Contributor

ijt commented Jul 23, 2018

Using a flag is problematic because all tests would have to know about clouds and projects. Environment variables don't have this problem.

One possibility is to have a $CLOUD_PROJECTS environment variable with a comma-separated list of cloud:project. It could be used like this:

CLOUD_PROJECTS=aws:project1,gcp:project2 vgo test ./...

@vangent vangent modified the milestones: Unplanned, Sprint 15 Aug 6, 2018
@vangent vangent self-assigned this Aug 6, 2018
@vangent vangent removed the needs info Further discussion or clarification is necessary label Aug 9, 2018
@vangent
Copy link
Contributor

vangent commented Aug 9, 2018

We've decided to use Terraform for this. Basically:

  1. User runs Terraform to provision any resources needed for the test, and output.tf saves their names for use as test inputs (e.g., bucket name).
  2. User runs the test with --record, which makes a copy of output.tf for later replay and uses the inputs.
  3. User runs Terraform to clean up.

I'll open separate issues with more specific tasks.

@vangent vangent closed this as completed Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code health Code health task, either refactoring or testing
Projects
None yet
Development

No branches or pull requests

4 participants