Skip to content

Commit f9f6dc1

Browse files
committed
Login as the integration test user during teardown.
We no longer have access to the PLATFORM_API_TOKEN that was being used.
1 parent 8127b02 commit f9f6dc1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

internal/testhelpers/e2e/session.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,6 @@ func (s *Session) Close() error {
542542

543543
s.spawned = []*SpawnedCmd{}
544544

545-
if os.Getenv("PLATFORM_API_TOKEN") == "" {
546-
s.T.Log("PLATFORM_API_TOKEN env var not set, not running suite tear down")
547-
return nil
548-
}
549-
550545
auth := authentication.New(cfg)
551546

552547
if os.Getenv(constants.APIHostEnvVarName) == "" {
@@ -560,7 +555,8 @@ func (s *Session) Close() error {
560555
}
561556

562557
err = auth.AuthenticateWithModel(&mono_models.Credentials{
563-
Token: os.Getenv("PLATFORM_API_TOKEN"),
558+
Username: os.Getenv(PersistentUsername),
559+
Password: os.Getenv(PersistentPassword),
564560
})
565561
if err != nil {
566562
return err
@@ -586,7 +582,7 @@ func (s *Session) Close() error {
586582
for _, proj := range s.createdProjects {
587583
err := model.DeleteProject(proj.Owner, proj.Project, auth)
588584
if err != nil {
589-
s.T.Errorf("Could not delete project %s: %v", proj.Project, errs.JoinMessage(err))
585+
s.T.Errorf("Could not delete project %s/%s: %v", proj.Owner, proj.Project, errs.JoinMessage(err))
590586
}
591587
}
592588

0 commit comments

Comments
 (0)