{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/224","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/224/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/224/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/224","id":141287205,"number":224,"title":"datastore: local test harness against emulators","user":{"login":"mwitkow","id":9655971,"avatar_url":"https://avatars.githubusercontent.com/u/9655971?v=3","gravatar_id":"","url":"https://api.github.com/users/mwitkow","html_url":"https://github.com/mwitkow","followers_url":"https://api.github.com/users/mwitkow/followers","following_url":"https://api.github.com/users/mwitkow/following{/other_user}","gists_url":"https://api.github.com/users/mwitkow/gists{/gist_id}","starred_url":"https://api.github.com/users/mwitkow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwitkow/subscriptions","organizations_url":"https://api.github.com/users/mwitkow/orgs","repos_url":"https://api.github.com/users/mwitkow/repos","events_url":"https://api.github.com/users/mwitkow/events{/privacy}","received_events_url":"https://api.github.com/users/mwitkow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/labels/datastore","name":"datastore","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-03-16T14:11:09Z","updated_at":"2016-05-11T04:21:09Z","closed_at":null,"body":"We're using `stretchr/testify/suite` to test our code related to Datastore entities. For the purpose of these suites we wrote a testing harness around the old `gcd-v1beta2-rev1-4.0.0` Local Development server. \r\nBasically what it would do is: \r\n * initialize a random project name\r\n * apply the user specified `index.xml` file\r\n * start the server at a free, random port (so we can run these in parallel on Jenkins)\r\n * stop the service and cleanup after the `suite` finished\r\nThe `harness` would expose the new project name and a \r\n```go\r\nfunc (s *LocalDatabase) DatastoreClientOption() []cloud.ClientOption {\r\n\treturn []cloud.ClientOption{\r\n\t\tcloud.WithEndpoint(fmt.Sprintf(\"http://localhost:%d/datastore/v1beta2/datasets/\", s.serverPort)),\r\n\t\tcloud.WithScopes(),\r\n\t\tcloud.WithTokenSource(nil),\r\n\t}\r\n```\r\nthat we'd use for our client connections. \r\n\r\nHowever, with Emulators we can no longer do this, since it is really really hard to bootstrap the `gcloud emulators` programatically. \r\n\r\nIs providing easy to use test bindings against Emulators something that you're planning? "},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/comments/218358042","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/224#issuecomment-218358042","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/224","id":218358042,"user":{"login":"derekperkins","id":3588778,"avatar_url":"https://avatars.githubusercontent.com/u/3588778?v=3","gravatar_id":"","url":"https://api.github.com/users/derekperkins","html_url":"https://github.com/derekperkins","followers_url":"https://api.github.com/users/derekperkins/followers","following_url":"https://api.github.com/users/derekperkins/following{/other_user}","gists_url":"https://api.github.com/users/derekperkins/gists{/gist_id}","starred_url":"https://api.github.com/users/derekperkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekperkins/subscriptions","organizations_url":"https://api.github.com/users/derekperkins/orgs","repos_url":"https://api.github.com/users/derekperkins/repos","events_url":"https://api.github.com/users/derekperkins/events{/privacy}","received_events_url":"https://api.github.com/users/derekperkins/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T04:21:09Z","updated_at":"2016-05-11T04:21:09Z","body":"> Your test functions will only run one at a time unless you specifically opt into parallelism\r\n\r\n@okdave That's not entirely true if you run `go test ./...`, at least as of a few versions ago. We got bit by non-deterministic tests and it took a while to track down."}}