Skip to content

[integration-test] remove plan changing #17335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions test/pkg/integration/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,53 +556,6 @@ func (c *ComponentAPI) CreateUser(username string, token string) (string, error)
return userId, nil
}

func (c *ComponentAPI) MakeUserUnleashedPlan(username string) error {
db, err := c.DB()
if err != nil {
return err
}
defer db.Close()

var userId string
err = db.QueryRow(`SELECT id FROM d_b_user WHERE name = ?`, username).Scan(&userId)
if err != nil {
return err
}

var subId string
err = db.QueryRow(`SELECT uid FROM d_b_subscription WHERE userId = ? and planId = ?`, username, "professional-eur").Scan(&subId)
if err != nil && !errors.Is(err, sql.ErrNoRows) {
return err
}
if subId != "" {
return nil
}

// reset all of this user subscription
_, err = db.Exec(`DELETE from d_b_subscription WHERE userId = ?`, userId)
if err != nil {
return err
}

uid, err := uuid.NewRandom()
if err != nil {
return err
}

_, err = db.Exec(`INSERT INTO d_b_subscription (uid, userId, startDate, amount, planId) VALUES (?, ?, ?, ?, ?)`,
uid,
userId,
"2022-10-19T00:00:00.000Z",
11904,
"professional-eur",
)
if err != nil {
return err
}

return nil
}

func (c *ComponentAPI) createGitpodToken(user string, scopes []string) (tkn string, err error) {
id, err := c.GetUserId(user)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions test/tests/ide/jetbrains/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ func JetBrainsIDETest(ctx context.Context, t *testing.T, cfg *envconf.Config, id
if err != nil {
t.Fatal(err)
}
err = api.MakeUserUnleashedPlan(username)
if err != nil {
t.Fatal(err)
}

t.Logf("connecting to server...")
server, err := api.GitpodServer(integration.WithGitpodUser(username))
Expand Down
4 changes: 0 additions & 4 deletions test/tests/workspace/contexts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ func runContextTests(t *testing.T, tests []ContextTest) {
if err := api.UpdateUserFeatureFlag(userId, ff.FF); err != nil {
t.Fatal(err)
}

if err := api.MakeUserUnleashedPlan(username); err != nil {
t.Fatal(err)
}
}()
}

Expand Down