Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simisoft-exo committed Oct 29, 2024
1 parent b5c5d84 commit aa4b89c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/resources/database/datasource_uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func uriWithPassword(uri string, username string, password string) (string, erro
matches := re.FindStringSubmatch(uri)

if len(matches) != 4 {
return "", fmt.Errorf("URI must contain username (format: protocol://[email protected])")
return "", fmt.Errorf("uri must contain username (format: protocol://[email protected])")
}

return fmt.Sprintf("%s://%s:%s@%s",
Expand Down
4 changes: 2 additions & 2 deletions pkg/resources/database/resource_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func testResourceMysql(t *testing.T) {
dataCreate.MaintenanceTime = "01:23:00"
dataCreate.BackupSchedule = "01:23"
dataCreate.IpFilter = []string{"1.2.3.4/32"}
dataCreate.MysqlSettings = strconv.Quote(`{"sql_mode":"ANSI,TRADITIONAL","sql_require_primary_key":true}`)
dataCreate.MysqlSettings = strconv.Quote(`{"log_output":"INSIGHTS","long_query_time":1,"sql_mode":"ANSI,TRADITIONAL","sql_require_primary_key":true}`)
buf := &bytes.Buffer{}
err = tpl.Execute(buf, &dataCreate)
if err != nil {
Expand All @@ -75,7 +75,7 @@ func testResourceMysql(t *testing.T) {
dataUpdate.MaintenanceTime = "02:34:00"
dataUpdate.BackupSchedule = "23:45"
dataUpdate.IpFilter = nil
dataUpdate.MysqlSettings = strconv.Quote(`{"long_query_time":5,"sql_mode":"ANSI,TRADITIONAL","sql_require_primary_key":true}`)
dataUpdate.MysqlSettings = strconv.Quote(`{"log_output":"INSIGHTS","long_query_time":1,"sql_mode":"ANSI,TRADITIONAL","sql_require_primary_key":true}`)
buf = &bytes.Buffer{}
err = tpl.Execute(buf, &dataUpdate)
if err != nil {
Expand Down

0 comments on commit aa4b89c

Please sign in to comment.