mirror of
https://github.com/dolthub/dolt.git
synced 2025-12-17 03:38:55 -06:00
/{.github,go}: try fixing doltgres benchmark runner tests
This commit is contained in:
@@ -20,6 +20,5 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- name: Copy Dockerfile
|
||||
run: cp -r ./go/performance/continuous_integration/. .
|
||||
# TODO: fix this before rerunning
|
||||
# - name: Test runner
|
||||
# uses: ./.github/actions/benchmark-runner-tests
|
||||
- name: Test runner
|
||||
uses: ./.github/actions/benchmark-runner-tests
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# syntax=docker/dockerfile:1.3-labs
|
||||
FROM --platform=linux/amd64 golang:1.22-alpine as gobin
|
||||
FROM --platform=linux/amd64 ubuntu:22.04
|
||||
|
||||
@@ -40,6 +41,19 @@ RUN cd doltgresql/utils/doltgres_builder/cmd && go run . "$DOLTGRESQL_VERSION"
|
||||
ENV PATH="/doltgresql/utils/doltgres_builder/cmd/doltgresBin/$DOLTGRESQL_VERSION:${PATH}"
|
||||
RUN doltgres -version
|
||||
|
||||
RUN << EOF > /doltgres/config.yaml
|
||||
log_level: info
|
||||
|
||||
behavior:
|
||||
read_only: false
|
||||
|
||||
listener:
|
||||
host: 127.0.0.1
|
||||
port: 4433
|
||||
read_timeout_millis: 28800000
|
||||
write_timeout_millis: 28800000
|
||||
EOF
|
||||
|
||||
WORKDIR /mysql
|
||||
RUN apt install -y mysql-server
|
||||
RUN mysql --version
|
||||
@@ -94,6 +108,7 @@ ENV BENCHMARK_RUNNER_MYSQL_EXEC="/usr/sbin/mysqld"
|
||||
ENV BENCHMARK_RUNNER_MYSQL_PROTOCOL="unix"
|
||||
ENV BENCHMARK_RUNNER_MYSQL_SOCKET="/home/tester/.mysql/mysqld.sock"
|
||||
ENV BENCHMARK_RUNNER_DOLTGRES_EXEC="/doltgresql/utils/doltgres_builder/cmd/doltgresBin/$DOLTGRESQL_VERSION/doltgres"
|
||||
ENV BENCHMARK_RUNNER_DOLTGRES_CONFIG_FILE_PATH="/doltgres/config.yaml"
|
||||
ENV BENCHMARK_RUNNER_POSTGRES_EXEC="/usr/lib/postgresql/15/bin/postgres"
|
||||
ENV BENCHMARK_RUNNER_POSTGRES_INIT_EXEC="/usr/lib/postgresql/15/bin/initdb"
|
||||
ENV BENCHMARK_RUNNER_SYSBENCH_LUA_SCRIPTS="/sysbench-lua-scripts"
|
||||
|
||||
@@ -62,6 +62,7 @@ const (
|
||||
|
||||
doltSqlServerCommand = "sql-server"
|
||||
|
||||
configFlag = "--config"
|
||||
userFlag = "--user"
|
||||
hostFlag = "--host"
|
||||
portFlag = "--port"
|
||||
|
||||
@@ -33,6 +33,9 @@ type doltgresServerConfigImpl struct {
|
||||
// Version is the server version
|
||||
Version string
|
||||
|
||||
// ConfigFilePath is the path to a doltgres config file
|
||||
ConfigFilePath string
|
||||
|
||||
// ResultsFormat is the format the results should be written in
|
||||
ResultsFormat string
|
||||
|
||||
@@ -48,16 +51,17 @@ type doltgresServerConfigImpl struct {
|
||||
|
||||
var _ ServerConfig = &doltgresServerConfigImpl{}
|
||||
|
||||
func NewDoltgresServerConfig(version, serverExec, serverUser, host, resultsFormat string, port int, serverArgs []string) *doltgresServerConfigImpl {
|
||||
func NewDoltgresServerConfig(version, serverExec, serverUser, host, resultsFormat, configFilePath string, port int, serverArgs []string) *doltgresServerConfigImpl {
|
||||
return &doltgresServerConfigImpl{
|
||||
Id: uuid.New().String(),
|
||||
Host: host,
|
||||
Port: port,
|
||||
Version: version,
|
||||
ResultsFormat: resultsFormat,
|
||||
ServerExec: serverExec,
|
||||
ServerUser: serverUser,
|
||||
ServerArgs: serverArgs,
|
||||
Id: uuid.New().String(),
|
||||
Host: host,
|
||||
Port: port,
|
||||
Version: version,
|
||||
ConfigFilePath: configFilePath,
|
||||
ResultsFormat: resultsFormat,
|
||||
ServerExec: serverExec,
|
||||
ServerUser: serverUser,
|
||||
ServerArgs: serverArgs,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,13 +78,20 @@ func (sc *doltgresServerConfigImpl) GetResultsFormat() string {
|
||||
}
|
||||
|
||||
func (sc *doltgresServerConfigImpl) GetServerArgs() ([]string, error) {
|
||||
|
||||
params := make([]string, 0)
|
||||
if sc.Host != "" {
|
||||
params = append(params, fmt.Sprintf("%s=%s", hostFlag, sc.Host))
|
||||
}
|
||||
if sc.Port != 0 {
|
||||
params = append(params, fmt.Sprintf("%s=%d", portFlag, sc.Port))
|
||||
}
|
||||
|
||||
// TODO: doltgres removed support for command line flag configuration
|
||||
// TODO: see https://github.com/dolthub/doltgresql/issues/321
|
||||
params = append(params, fmt.Sprintf("%s=%s", configFlag, sc.ConfigFilePath))
|
||||
|
||||
//if sc.Host != "" {
|
||||
// params = append(params, fmt.Sprintf("%s=%s", hostFlag, sc.Host))
|
||||
//}
|
||||
//if sc.Port != 0 {
|
||||
// params = append(params, fmt.Sprintf("%s=%d", portFlag, sc.Port))
|
||||
//}
|
||||
|
||||
params = append(params, sc.ServerArgs...)
|
||||
return params, nil
|
||||
}
|
||||
@@ -110,6 +121,9 @@ func (sc *doltgresServerConfigImpl) Validate() error {
|
||||
if sc.ServerExec == "" {
|
||||
return getMustSupplyError("server exec")
|
||||
}
|
||||
if sc.ConfigFilePath == "" {
|
||||
return getMustSupplyError("config file path")
|
||||
}
|
||||
return CheckExec(sc.ServerExec, "server exec")
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ var mysqlSocket = os.Getenv("BENCHMARK_RUNNER_MYSQL_SOCKET")
|
||||
var mysqlVersion = os.Getenv("BENCHMARK_RUNNER_MYSQL_VERSION")
|
||||
var doltgresExec = os.Getenv("BENCHMARK_RUNNER_DOLTGRES_EXEC")
|
||||
var doltgresVersion = os.Getenv("BENCHMARK_RUNNER_DOLTGRES_VERSION")
|
||||
var doltgresConfigFilePath = os.Getenv("BENCHMARK_RUNNER_DOLTGRES_CONFIG_FILE_PATH")
|
||||
var postgresExec = os.Getenv("BENCHMARK_RUNNER_POSTGRES_EXEC")
|
||||
var postgresInitExec = os.Getenv("BENCHMARK_RUNNER_POSTGRES_INIT_EXEC")
|
||||
var postgresVersion = os.Getenv("BENCHMARK_RUNNER_POSTGRES_VERSION")
|
||||
@@ -147,6 +148,10 @@ func TestDoltgresPostgresSysbenchRunner(t *testing.T) {
|
||||
if runTests == "" {
|
||||
t.Skip()
|
||||
}
|
||||
if doltgresConfigFilePath == "" {
|
||||
t.Skip("skipping doltgres/postgres benchmark runner tests, no config file specified")
|
||||
}
|
||||
|
||||
dir := t.TempDir()
|
||||
log.Println(dir)
|
||||
err := os.Chdir(dir)
|
||||
@@ -170,12 +175,13 @@ func TestDoltgresPostgresSysbenchRunner(t *testing.T) {
|
||||
ServerUser: "root",
|
||||
},
|
||||
&doltgresServerConfigImpl{
|
||||
Id: "test-doltgres",
|
||||
Port: 4433,
|
||||
Host: "127.0.0.1",
|
||||
Version: doltgresVersion,
|
||||
ResultsFormat: CsvFormat,
|
||||
ServerExec: doltgresExec,
|
||||
Id: "test-doltgres",
|
||||
Port: 4433,
|
||||
Host: "127.0.0.1",
|
||||
ConfigFilePath: doltgresConfigFilePath,
|
||||
Version: doltgresVersion,
|
||||
ResultsFormat: CsvFormat,
|
||||
ServerExec: doltgresExec,
|
||||
},
|
||||
},
|
||||
TestOptions: []string{
|
||||
|
||||
Reference in New Issue
Block a user