mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-26 18:16:47 -05:00
test(proxy): build the test metrics from the default config
Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
1 parent
814a2a763f
commit
1aa9a5a80d
1 file changed
+4
-2
@@ -26,9 +26,11 @@ var (
|
||||
testMetricsErr error
|
||||
)
|
||||
|
||||
func newTestMetrics(t *testing.T, cfg *config.Config) metrics.Metrics {
|
||||
// newTestMetrics returns metrics for the routes of the default config.
|
||||
func newTestMetrics(t *testing.T) metrics.Metrics {
|
||||
t.Helper()
|
||||
testMetricsOnce.Do(func() {
|
||||
cfg := defaults.FullDefaultConfig()
|
||||
logger := log.NopLogger()
|
||||
testMetrics, testMetricsErr = metrics.New(func(yield func(config.Route) bool) {
|
||||
for _, pol := range cfg.Policies {
|
||||
@@ -98,7 +100,7 @@ func TestUnauthenticatedRequestChallenges(t *testing.T) {
|
||||
chain, err := loadMiddlewares(
|
||||
log.NopLogger(), cfg,
|
||||
microstore.NewMemoryStore(), microstore.NewMemoryStore(),
|
||||
noop.NewTracerProvider(), newTestMetrics(t, cfg),
|
||||
noop.NewTracerProvider(), newTestMetrics(t),
|
||||
nil, nil, nil, selector.NewSelector(),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in new issue
Block a user