Skip to content

Commit

Permalink
go db: Change default database to use "dev" password (same as local)
Browse files Browse the repository at this point in the history
Summary: Changes the default test fixture to use "dev" as the password
for databases.
  • Loading branch information
Will Hughes authored and willhug committed Oct 9, 2018
1 parent f07e38b commit 08a2d11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ services:
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ROOT_PASSWORD: "dev"
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"

9 changes: 1 addition & 8 deletions internal/testfixtures/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"database/sql"
"fmt"
"math/rand"
"os"
)

type DBConfig struct {
Expand All @@ -20,17 +19,11 @@ func (d DBConfig) String() string {

var DefaultDBConfig = DBConfig{
Username: "root",
Password: "",
Password: "dev",
Hostname: "localhost",
Port: 3307,
}

func init() {
if pw := os.Getenv("DB_PASSWORD"); pw != "" {
DefaultDBConfig.Password = pw
}
}

type TestDatabase struct {
DBName string
ControlDB *sql.DB
Expand Down

0 comments on commit 08a2d11

Please sign in to comment.