Repository navigation
Local testing for google cloud storage #1032
Description
Activity
I'm not sure I understand. Can you give an example of what you're trying to do and what's happening?
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on 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.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?
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
@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.No problem, thanks for asking!
- added a commit that references this issue
on Jul 23, 2025 - added a commit that references this issue
on Feb 3, 2026 - added a commit that references this issue
on Mar 27, 2026
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 ?