-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metrics qualifiers for structs that inject metrics (#237)
* add metrics qualifiers for structs that inject metrics * add tests for verifying named metrics dependencies
- Loading branch information
1 parent
1f9bb9b
commit 76ab1a9
Showing
10 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,29 @@ | ||
// +build all race | ||
|
||
package sample | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/facebookgo/inject" | ||
"github.com/honeycombio/refinery/config" | ||
"github.com/honeycombio/refinery/logger" | ||
"github.com/honeycombio/refinery/metrics" | ||
) | ||
|
||
func TestDependencyInjection(t *testing.T) { | ||
var g inject.Graph | ||
err := g.Provide( | ||
&inject.Object{Value: &SamplerFactory{}}, | ||
|
||
&inject.Object{Value: &config.MockConfig{}}, | ||
&inject.Object{Value: &logger.NullLogger{}}, | ||
&inject.Object{Value: &metrics.NullMetrics{}, Name: "metrics"}, | ||
) | ||
if err != nil { | ||
t.Error(err) | ||
} | ||
if err := g.Populate(); err != nil { | ||
t.Error(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters