Git Product home page Git Product logo

Comments (6)

notque avatar notque commented on September 16, 2024

go test -v ./pkg/api/ works to run tests in a folder, but running from the main dir doesn't explore. There is another command you can run with go 1.9. I'm on 1.8, so will upgrade, test the command, change the makefile to use it, validate it's on 1.9, and I think that's a solution.

from hermes.

notque avatar notque commented on September 16, 2024

upgrading to 1.9 allows the go test -v ./pkg/api to work on the command line. All of the tests were being testing individually, now together there is an error

panic: duplicate metrics collector registration attempted [recovered]

Sorting out how to fix now.

from hermes.

notque avatar notque commented on September 16, 2024

The problem is how we're registering prometheus for each endpoint instead of the standard in init. This is to attach labels on the prometheus metrics instead of having an individual metric for each end point.

This is not a problem normally because you don't run register multiple times, but in the case of multiple tests it's registering.

I need to either set a mock flag to know if to register it or not, or to move the registering to a different place.... hrm... still thinking of ideas.

from hermes.

notque avatar notque commented on September 16, 2024

Another option is we can attach labels after the fact, so we could init the tests and registration, then in the function just attach the label for each handler.

from hermes.

notque avatar notque commented on September 16, 2024

Wrote a teardown function to unregister the collectors for Prom, but it doesn't allow you to reregistar with the same name (to not get screwy metrics).

So back to the drawing board.

from hermes.

notque avatar notque commented on September 16, 2024

Corrected this, now running all tests. Their passing is a different issue I'll continue. Closing this one.

from hermes.

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.