2024-07-26 20:39:55 +00:00
|
|
|
//go:build integration
|
|
|
|
|
|
|
|
package settings_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/zitadel/zitadel/internal/integration"
|
|
|
|
settings "github.com/zitadel/zitadel/pkg/grpc/settings/v2beta"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
CTX, AdminCTX context.Context
|
2024-09-06 12:47:57 +00:00
|
|
|
Instance *integration.Instance
|
2024-07-26 20:39:55 +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-07-26 20:39:55 +00:00
|
|
|
defer cancel()
|
|
|
|
|
2024-09-06 12:47:57 +00:00
|
|
|
Instance = integration.NewInstance(ctx)
|
2024-07-26 20:39:55 +00:00
|
|
|
|
|
|
|
CTX = ctx
|
2024-09-06 12:47:57 +00:00
|
|
|
AdminCTX = Instance.WithAuthorization(ctx, integration.UserTypeIAMOwner)
|
|
|
|
Client = Instance.Client.SettingsV2beta
|
2024-07-26 20:39:55 +00:00
|
|
|
return m.Run()
|
|
|
|
}())
|
|
|
|
}
|