Skip to content

Commit

Permalink
Fix maintenance day of week (linode#374)
Browse files Browse the repository at this point in the history
For the DBaaS maintenance window,

Our API considers:
1=Monday, 2=Tuesday, ...

But our existing `linodego` code considers:
1=Sunday, 2=Monday ...

This PR makes `linodego` align with the API design.
  • Loading branch information
zliang-akamai authored Sep 5, 2023
1 parent cc1e919 commit 1df9dbe
Show file tree
Hide file tree
Showing 7 changed files with 6,267 additions and 9,199 deletions.
4 changes: 2 additions & 2 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ type (
)

const (
DatabaseMaintenanceDaySunday DatabaseDayOfWeek = iota + 1
DatabaseMaintenanceDayMonday
DatabaseMaintenanceDayMonday DatabaseDayOfWeek = iota + 1
DatabaseMaintenanceDayTuesday
DatabaseMaintenanceDayWednesday
DatabaseMaintenanceDayThursday
DatabaseMaintenanceDayFriday
DatabaseMaintenanceDaySaturday
DatabaseMaintenanceDaySunday
)

const (
Expand Down
2,581 changes: 935 additions & 1,646 deletions test/integration/fixtures/TestDatabase_List.yaml

Large diffs are not rendered by default.

6,252 changes: 2,634 additions & 3,618 deletions test/integration/fixtures/TestDatabase_MySQL_Suite.yaml

Large diffs are not rendered by default.

6,617 changes: 2,690 additions & 3,927 deletions test/integration/fixtures/TestDatabase_Postgres_Suite.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions test/integration/integration_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ var (
)

var (
testingPollDuration = time.Duration(15000)
testingMaxRetryTime = time.Duration(30) * time.Second
testingPollDuration = 15 * time.Second
testingMaxRetryTime = 30 * time.Second
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func createMySQLDatabase(t *testing.T, client *linodego.Client,
Label: "go-mysql-test-def",
Region: getRegionsWithCaps(t, client, []string{"Managed Databases"})[0],
Type: "g6-nanode-1",
Engine: "mysql/8.0.26",
Engine: "mysql/8.0.30",
Encrypted: false,
ClusterSize: 3,
ReplicationType: "semi_synch",
Expand All @@ -204,7 +204,7 @@ func createMySQLDatabase(t *testing.T, client *linodego.Client,
ctx, cancel := context.WithTimeout(context.Background(), 180*time.Second)
defer cancel()

ticker := time.NewTicker(client.GetPollDelay() * time.Millisecond)
ticker := time.NewTicker(client.GetPollDelay())
defer ticker.Stop()

for {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func createPostgresDatabase(t *testing.T, client *linodego.Client,
Label: "go-postgres-testing-def",
Region: getRegionsWithCaps(t, client, []string{"Managed Databases"})[0],
Type: "g6-nanode-1",
Engine: "postgresql/10.14",
Engine: "postgresql/14.6",
Encrypted: false,
SSLConnection: false,
ClusterSize: 3,
Expand All @@ -203,7 +203,7 @@ func createPostgresDatabase(t *testing.T, client *linodego.Client,
ctx, cancel := context.WithTimeout(context.Background(), 180*time.Second)
defer cancel()

ticker := time.NewTicker(client.GetPollDelay() * time.Millisecond)
ticker := time.NewTicker(client.GetPollDelay())
defer ticker.Stop()

for {
Expand Down

0 comments on commit 1df9dbe

Please sign in to comment.