diff --git a/internal/integration/config.go b/internal/integration/config.go index 5aea740752..96512b668d 100644 --- a/internal/integration/config.go +++ b/internal/integration/config.go @@ -26,23 +26,10 @@ var ( ) var ( - tmpDir string loadedConfig Config ) -// TmpDir returns the absolute path to the projects's temp directory. -func TmpDir() string { - return tmpDir -} - func init() { - cmd := exec.Command("git", "rev-parse", "--show-toplevel") - out, err := cmd.Output() - if err != nil { - panic(err) - } - tmpDir = filepath.Join(string(bytes.TrimSpace(out)), "tmp") - if err := yaml.Unmarshal(clientYAML, &loadedConfig); err != nil { panic(err) } diff --git a/internal/integration/instance.go b/internal/integration/instance.go index 6113bf0e37..2cff2e95e0 100644 --- a/internal/integration/instance.go +++ b/internal/integration/instance.go @@ -97,22 +97,6 @@ type Instance struct { WebAuthN *webauthn.Client } -// GetFirstInstance returns the default instance and org information, -// with authorized machine users. -// Using the first instance is not recommended as parallel test might -// interfere with each other. -// It is recommended to use [NewInstance] instead. -func GetFirstInstance(ctx context.Context) *Instance { - i := &Instance{ - Config: loadedConfig, - Domain: loadedConfig.Hostname, - } - token := loadInstanceOwnerPAT() - i.setClient(ctx) - i.setupInstance(ctx, token) - return i -} - // NewInstance returns a new instance that can be used for integration tests. // The instance contains a gRPC client connected to the domain of this instance. // The included users are the IAM_OWNER, ORG_OWNER of the default org and @@ -206,14 +190,6 @@ func (i *Instance) Host() string { return fmt.Sprintf("%s:%d", i.Domain, i.Config.Port) } -func loadInstanceOwnerPAT() string { - data, err := os.ReadFile(filepath.Join(tmpDir, adminPATFile)) - if err != nil { - panic(err) - } - return string(bytes.TrimSpace(data)) -} - func (i *Instance) createMachineUserInstanceOwner(ctx context.Context, token string) { mustAwait(func() error { user, err := i.Client.Auth.GetMyUser(WithAuthorizationToken(ctx, token), &auth.GetMyUserRequest{})