Skip to content

Local testing for google cloud storage #1032

Description

@ymohii

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 ?

Activity

  1. stephenplusplus commented on Dec 19, 2015

    @stephenplusplus
    Contributor

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

  2. added
    type: questionRequest for information or clarification. Not an issue.
    api: storageIssues related to the Cloud Storage API.
    on Dec 19, 2015
  3. ymohii commented on Dec 19, 2015

    @ymohii
    Author

    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.

  4. jgeewax commented on Dec 19, 2015

    @jgeewax
    Contributor

    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?

  5. stephenplusplus commented on Dec 19, 2015

    @stephenplusplus
    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

  6. ymohii commented on Dec 19, 2015

    @ymohii
    Author

    @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.

  7. stephenplusplus commented on Dec 19, 2015

    @stephenplusplus
    Contributor

    No problem, thanks for asking!

  8. added a commit that references this issue on Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions