Skip to content

Commit 1088462

Browse files
committed
We no longer create users in tests, so delete the associated code.
Remove references to `PLATFORM_API_TOKEN` secret, which we no longer have.
1 parent 45fe383 commit 1088462

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ jobs:
336336
INTEGRATION_TEST_USERNAME: ${{ secrets.INTEGRATION_TEST_USERNAME }}
337337
INTEGRATION_TEST_PASSWORD: ${{ secrets.INTEGRATION_TEST_PASSWORD }}
338338
INTEGRATION_TEST_TOKEN: ${{ secrets.INTEGRATION_TEST_TOKEN }}
339-
PLATFORM_API_TOKEN: ${{ secrets.PLATFORM_API_TOKEN }}
340339

341340
- # === Check if Unit Tests Failed ===
342341
name: Check if Unit Tests Failed

internal/testhelpers/e2e/clean.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,12 @@
11
package e2e
22

33
import (
4-
"testing"
5-
64
"github.com/ActiveState/cli/internal/errs"
75
"github.com/ActiveState/cli/pkg/platform/api/mono/mono_client/projects"
8-
"github.com/ActiveState/cli/pkg/platform/api/mono/mono_client/users"
96
"github.com/ActiveState/cli/pkg/platform/api/mono/mono_models"
107
"github.com/ActiveState/cli/pkg/platform/authentication"
11-
"github.com/ActiveState/cli/pkg/platform/model"
128
)
139

14-
func cleanUser(t *testing.T, username string, auth *authentication.Auth) error {
15-
projects, err := getProjects(username, auth)
16-
if err != nil {
17-
return err
18-
}
19-
for _, proj := range projects {
20-
err = model.DeleteProject(username, proj.Name, auth)
21-
if err != nil {
22-
return err
23-
}
24-
}
25-
26-
return deleteUser(username, auth)
27-
}
28-
2910
func getProjects(org string, auth *authentication.Auth) ([]*mono_models.Project, error) {
3011
authClient, err := auth.Client()
3112
if err != nil {
@@ -40,20 +21,3 @@ func getProjects(org string, auth *authentication.Auth) ([]*mono_models.Project,
4021

4122
return listProjectsOK.Payload, nil
4223
}
43-
44-
func deleteUser(name string, auth *authentication.Auth) error {
45-
authClient, err := auth.Client()
46-
if err != nil {
47-
return errs.Wrap(err, "Could not get auth client")
48-
}
49-
50-
params := users.NewDeleteUserParams()
51-
params.SetUsername(name)
52-
53-
_, err = authClient.Users.DeleteUser(params, auth.ClientAuth())
54-
if err != nil {
55-
return err
56-
}
57-
58-
return nil
59-
}

internal/testhelpers/e2e/session.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ type Session struct {
5656
Env []string
5757
retainDirs bool
5858
createdProjects []*project.Namespaced
59-
// users created during session
60-
users []string
6159
T *testing.T
6260
Exe string
6361
SvcExe string
@@ -587,13 +585,6 @@ func (s *Session) Close() error {
587585
}
588586
}
589587

590-
for _, user := range s.users {
591-
err := cleanUser(s.T, user, auth)
592-
if err != nil {
593-
s.T.Errorf("Could not delete user %s: %v", user, errs.JoinMessage(err))
594-
}
595-
}
596-
597588
// Add back the release state tool installation to the bash RC file.
598589
// This was done on session creation to ensure that the release state tool
599590
// does not appear on the PATH when a new subshell is started. This is a

0 commit comments

Comments
 (0)