2024-02-28 10:21:11 +00:00
|
|
|
//go:build integration
|
|
|
|
|
|
|
|
package settings_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/integration"
|
2024-07-26 20:39:55 +00:00
|
|
|
"github.com/zitadel/zitadel/pkg/grpc/settings/v2"
|
2024-02-28 10:21:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
CTX, AdminCTX context.Context
|
2024-09-06 12:47:57 +00:00
|
|
|
Instance *integration.Instance
|
2024-02-28 10:21:11 +00:00
|
|
|
Client settings.SettingsServiceClient
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
os.Exit(func() int {
|
2024-09-06 12:47:57 +00:00
|
|
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
2024-02-28 10:21:11 +00:00
|
|
|
defer cancel()
|
|
|
|
|
2024-09-06 12:47:57 +00:00
|
|
|
Instance = integration.NewInstance(ctx)
|
2024-02-28 10:21:11 +00:00
|
|
|
|
|
|
|
CTX = ctx
|
2024-09-06 12:47:57 +00:00
|
|
|
AdminCTX = Instance.WithAuthorization(ctx, integration.UserTypeIAMOwner)
|
|
|
|
Client = Instance.Client.SettingsV2
|
2024-02-28 10:21:11 +00:00
|
|
|
return m.Run()
|
|
|
|
}())
|
|
|
|
}
|