Move log test helpers to separate package.

This commit is contained in:
Joachim Bauch 2026-01-12 13:58:33 +01:00
commit ee6f026bbb
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
42 changed files with 236 additions and 151 deletions

View file

@ -47,6 +47,7 @@ import (
"github.com/strukturag/nextcloud-spreed-signaling/api"
"github.com/strukturag/nextcloud-spreed-signaling/internal"
"github.com/strukturag/nextcloud-spreed-signaling/log"
logtest "github.com/strukturag/nextcloud-spreed-signaling/log/test"
"github.com/strukturag/nextcloud-spreed-signaling/proxy"
"github.com/strukturag/nextcloud-spreed-signaling/sfu"
"github.com/strukturag/nextcloud-spreed-signaling/talk"
@ -142,7 +143,7 @@ func newProxyServerForTest(t *testing.T) (*ProxyServer, *rsa.PrivateKey, *httpte
config := goconf.NewConfigFile()
config.AddOption("tokens", TokenIdForTest, pubkey.Name())
logger := log.NewLoggerForTest(t)
logger := logtest.NewLoggerForTest(t)
ctx := log.NewLoggerContext(t.Context(), logger)
proxy, err = NewProxyServer(ctx, r, "0.0", config)
require.NoError(err)

View file

@ -41,7 +41,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zaptest"
"github.com/strukturag/nextcloud-spreed-signaling/log"
logtest "github.com/strukturag/nextcloud-spreed-signaling/log/test"
"github.com/strukturag/nextcloud-spreed-signaling/test"
)
@ -97,7 +97,7 @@ func newTokensEtcdForTesting(t *testing.T) (*tokensEtcd, *embed.Etcd) {
cfg.AddOption("etcd", "endpoints", etcd.Config().ListenClientUrls[0].String())
cfg.AddOption("tokens", "keyformat", "/%s, /testing/%s/key")
logger := log.NewLoggerForTest(t)
logger := logtest.NewLoggerForTest(t)
tokens, err := NewProxyTokensEtcd(logger, cfg)
require.NoError(t, err)
t.Cleanup(func() {