2023-04-25 18:11:04 +03:00
|
|
|
//go:build integration
|
|
|
|
|
2023-04-25 15:04:35 +03:00
|
|
|
package admin_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
2023-04-25 18:11:04 +03:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
2023-04-25 15:04:35 +03:00
|
|
|
"github.com/zitadel/zitadel/internal/integration"
|
2023-04-25 18:11:04 +03:00
|
|
|
"github.com/zitadel/zitadel/pkg/grpc/admin"
|
2023-04-25 15:04:35 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
Tester *integration.Tester
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
os.Exit(func() int {
|
2023-04-28 14:39:53 +03:00
|
|
|
ctx, _, cancel := integration.Contexts(time.Minute)
|
2023-04-25 15:04:35 +03:00
|
|
|
defer cancel()
|
2023-04-25 18:11:04 +03:00
|
|
|
Tester = integration.NewTester(ctx)
|
2023-04-25 15:04:35 +03:00
|
|
|
defer Tester.Done()
|
|
|
|
|
|
|
|
return m.Run()
|
|
|
|
}())
|
|
|
|
}
|
2023-04-25 18:11:04 +03:00
|
|
|
|
|
|
|
func TestServer_Healthz(t *testing.T) {
|
2023-06-07 17:28:42 +02:00
|
|
|
_, err := Tester.Client.Admin.Healthz(context.TODO(), &admin.HealthzRequest{})
|
2023-04-25 18:11:04 +03:00
|
|
|
require.NoError(t, err)
|
|
|
|
}
|