Skip to content

test: Enabled MySQL database #3318

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 4 commits into from
Apr 4, 2024
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
62 changes: 1 addition & 61 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,12 @@ services:
MYSQL_ROOT_PASSWORD: mysecretpassword
MYSQL_ROOT_HOST: '%'

mysql5:
image: "mysql/mysql-server:5.7"
ports:
- "3305:3306"
restart: always
environment:
MYSQL_DATABASE: dinotest
MYSQL_ROOT_PASSWORD: mysecretpassword
MYSQL_ROOT_HOST: '%'
profiles:
- mysql

postgresql:
image: "postgres:15"
image: "postgres:16"
ports:
- "5432:5432"
restart: always
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres

postgresql14:
image: "postgres:14"
ports:
- "5414:5432"
restart: always
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres
profiles:
- postgres

postgresql13:
image: "postgres:13"
ports:
- "5413:5432"
restart: always
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres
profiles:
- postgres

postgresql12:
image: "postgres:12"
ports:
- "5412:5432"
restart: always
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres
profiles:
- postgres

postgresql11:
image: "postgres:11"
ports:
- "5411:5432"
restart: always
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_USER: postgres
profiles:
- postgres
16 changes: 8 additions & 8 deletions internal/endtoend/endtoend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ func TestReplay(t *testing.T) {
c.SQL[i].Database = &config.Database{
URI: uri,
}
// case config.EngineMySQL:
// uri := local.MySQL(t, files)
// c.SQL[i].Database = &config.Database{
// URI: uri,
// }
case config.EngineMySQL:
uri := local.MySQL(t, files)
c.SQL[i].Database = &config.Database{
URI: uri,
}
default:
// pass
}
Expand All @@ -146,9 +146,9 @@ func TestReplay(t *testing.T) {
if len(os.Getenv("POSTGRESQL_SERVER_URI")) == 0 {
return false
}
// if len(os.Getenv("MYSQL_SERVER_URI")) == 0 {
// return false
// }
if len(os.Getenv("MYSQL_SERVER_URI")) == 0 {
return false
}
return true
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
CREATE TABLE authors (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name text NOT NULL,
bio text,
UNIQUE(name)
);

-- name: ListAuthors :many
SELECT *
FROM authors
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE authors (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name text NOT NULL,
bio text
);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"path": "go",
"engine": "mysql",
"name": "querytest",
"schema": "query.sql",
"schema": "schema.sql",
"queries": "query.sql"
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# package querytest
query.sql:11:10: column reference "invalid_reference" not found
query.sql:4:10: column reference "invalid_reference" not found
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
CREATE TABLE authors (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(10) NOT NULL,
bio text,
UNIQUE(name)
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(10) NOT NULL,
bio text
);

CREATE TABLE IF NOT EXISTS weather_metrics
Expand Down