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

Local testing for google cloud storage #1032

Closed
ymohii opened this issue Dec 19, 2015 · 6 comments
Closed

Local testing for google cloud storage #1032

ymohii opened this issue Dec 19, 2015 · 6 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: question Request for information or clarification. Not an issue.

Comments

@ymohii
Copy link

ymohii commented Dec 19, 2015

I'm writing an app with gcloud-node that needs to access Google Cloud Storage, but I could not find a way to test my app locally without writing my app GCS Buckets. Am i missing something ?

@stephenplusplus
Copy link
Contributor

I'm not sure I understand. Can you give an example of what you're trying to do and what's happening?

@stephenplusplus stephenplusplus added type: question Request for information or clarification. Not an issue. api: storage Issues related to the Cloud Storage API. labels Dec 19, 2015
@ymohii
Copy link
Author

ymohii commented Dec 19, 2015

Sorry I didn't write it properly,
My Nodejs app is storing some files to google storage, what I need to do is to test it locally first without storing the files to Google Cloud Storage (saving them locally for example by appengine dev tools), May be there is no way to do it or may be there is something I'm missing.

@jgeewax
Copy link
Contributor

jgeewax commented Dec 19, 2015

I think this is asking for a local server that "acts like Google Cloud Storage" for the purpose of testing -- which I don't believe is available :( (/cc @Capstan who may know more than I do).

@stephenplusplus , for our tests, we mock out the calls first, right? Then for system tests we actually do write directly to GCS?

@stephenplusplus
Copy link
Contributor

We do use mocks for our unit tests and the real thing for our system tests. For your tests, @ymohii, I wouldn't cover anything that we already do. You can just stub out your calls to gcloud to pull out your callback. Then feed the callback simulated responses from gcloud-- you can get those from running the real thing once and taking a snapshot of the response.

Hope this is helpful. If it's available, I can try to help out in your actual code base. Here's an example of how a library using gcloud is testing: https://github.com/iamat/exo-dataset/tree/master/test

@ymohii
Copy link
Author

ymohii commented Dec 19, 2015

@stephenplusplus @jgeewax
Thanks guys for you quick responses, sounds logical to me :)
I think I can close this issue now.
and thanks @stephenplusplus for you kind propose to help me out.

@ymohii ymohii closed this as completed Dec 19, 2015
@stephenplusplus
Copy link
Contributor

No problem, thanks for asking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants