Giter Club home page Giter Club logo

Comments (4)

wojtekmach avatar wojtekmach commented on September 5, 2024 2

Alternatively, what's the suggested way of handling goth during testing? Check if the env is test and not add it to the supervisor tree?

Yes, exactly.

I'm going to close but of course feel free to keep discussing.

from goth.

wojtekmach avatar wojtekmach commented on September 5, 2024

A PR that raises a better error message would be very appreciated. Ideally we'd raise the same error as before:

iex(1)> Mix.install [{:goth, "~> 1.2.0"}]
:ok
iex(2)>
15:57:07.917 [notice] Application goth exited: Goth.start(:normal, []) returned an error: shutdown: failed to start child: Goth.Config
    ** (EXIT) an exception was raised:
        ** (RuntimeError)  Failed to retrieve project data from GCE internal metadata service.
                   Either you haven't configured your GCP credentials, you aren't running on GCE, or both.
                   Please see README.md for instructions on configuring your credentials.
            (goth 1.2.0) lib/goth/config.ex:182: Goth.Config.determine_project_id/2
            (goth 1.2.0) lib/goth/config.ex:73: anonymous fn/2 in Goth.Config.load_and_init/1
            (elixir 1.15.0-dev) lib/enum.ex:1662: anonymous fn/3 in Enum.map/2
            (stdlib 4.0.1) maps.erl:411: :maps.fold_1/3
            (elixir 1.15.0-dev) lib/enum.ex:2480: Enum.map/2
            (goth 1.2.0) lib/goth/config.ex:71: Goth.Config.load_and_init/1
            (stdlib 4.0.1) gen_server.erl:848: :gen_server.init_it/2
            (stdlib 4.0.1) gen_server.erl:811: :gen_server.init_it/6

from goth.

nwittstruck avatar nwittstruck commented on September 5, 2024

Thank you @wojtekmach for looking into this. I'm seeing the same. Is disabled: true supposed to be working during test in 1.3.1? Your response suggests that you'd like to add a better error message, but I think this should not result in an error at all.

Alternatively, what's the suggested way of handling goth during testing? Check if the env is test and not add it to the supervisor tree?

from goth.

dokie avatar dokie commented on September 5, 2024

I have the same query really, since goth will try to run with no configuration (as we only want to use goth in prod and not in development or testing - apart from in the integration testing cases we may have). For now I will adopt the approach that @nwittstruck suggests as a brute force workaround.

from goth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.