Skip to content

Commit

Permalink
Merge branch 'zachmu/enginetests' of github.com:dolthub/dolt into zac…
Browse files Browse the repository at this point in the history
…hmu/enginetests
  • Loading branch information
zachmu committed Jun 21, 2024
2 parents b68ac3d + bfae6a5 commit 85956dc
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/enginetest/dolt_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2046,4 +2046,4 @@ func TestStatsAutoRefreshConcurrency(t *testing.T) {

wg.Wait()
}
}
}
44 changes: 22 additions & 22 deletions go/libraries/doltcore/sqle/enginetest/dolt_engine_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ import (
"testing"
"time"

"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
"github.com/dolthub/dolt/go/store/datas"
"github.com/dolthub/dolt/go/store/types"
"github.com/dolthub/go-mysql-server/enginetest"
"github.com/dolthub/go-mysql-server/enginetest/queries"
"github.com/dolthub/go-mysql-server/enginetest/scriptgen/setup"
Expand All @@ -40,6 +34,13 @@ import (
"github.com/dolthub/vitess/go/mysql"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/dsess"
"github.com/dolthub/dolt/go/store/datas"
"github.com/dolthub/dolt/go/store/types"
)

const skipPreparedFlag = "DOLT_SKIP_PREPARED_ENGINETESTS"
Expand Down Expand Up @@ -1611,11 +1612,11 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) {
Query: "show create table test",
Expected: []sql.Row{
{"test", "CREATE TABLE `test` (\n" +
" `id` int NOT NULL,\n" +
" `c1` int,\n" +
" PRIMARY KEY (`id`),\n" +
" KEY `c1_idx` (`c1`)\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
" `id` int NOT NULL,\n" +
" `c1` int,\n" +
" PRIMARY KEY (`id`),\n" +
" KEY `c1_idx` (`c1`)\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
},
Expand Down Expand Up @@ -1661,12 +1662,12 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) {
Query: "show create table test",
Expected: []sql.Row{
{"test", "CREATE TABLE `test` (\n" +
" `id` int NOT NULL,\n" +
" `c1` int,\n" +
" PRIMARY KEY (`id`),\n" +
" KEY `c1_idx` (`c1`),\n" +
" CONSTRAINT `test_check` CHECK ((`c1` > 0))\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
" `id` int NOT NULL,\n" +
" `c1` int,\n" +
" PRIMARY KEY (`id`),\n" +
" KEY `c1_idx` (`c1`),\n" +
" CONSTRAINT `test_check` CHECK ((`c1` > 0))\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Expand Down Expand Up @@ -1738,10 +1739,10 @@ func RunAddDropPrimaryKeysTests(t *testing.T, harness DoltEnginetestHarness) {
Query: "show create table test",
Expected: []sql.Row{
{"test", "CREATE TABLE `test` (\n" +
" `id` int NOT NULL,\n" +
" `c1` int,\n" +
" KEY `c1_idx` (`c1`)\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
" `id` int NOT NULL,\n" +
" `c1` int,\n" +
" KEY `c1_idx` (`c1`)\n" +
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Expand Down Expand Up @@ -1942,4 +1943,3 @@ func RunDoltReflogTestsPrepared(t *testing.T, h DoltEnginetestHarness) {
}()
}
}

12 changes: 6 additions & 6 deletions go/libraries/doltcore/sqle/enginetest/dolt_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,28 @@ type DoltEnginetestHarness interface {
enginetest.KeylessTableHarness
enginetest.ReadOnlyDatabaseHarness
enginetest.ValidatingHarness

// NewHarness returns a new uninitialized harness of the same type
NewHarness(t *testing.T) DoltEnginetestHarness

// WithSkippedQueries returns a copy of the harness with the given queries skipped
WithSkippedQueries(skipped []string) DoltEnginetestHarness

// WithParallelism returns a copy of the harness with parallelism set to the given number of threads
WithParallelism(parallelism int) DoltEnginetestHarness

// WithConfigureStats returns a copy of the harness with the given configureStats value
WithConfigureStats(configureStats bool) DoltEnginetestHarness

// SkipSetupCommit configures to harness to skip the commit after setup scripts are run
SkipSetupCommit()

// UseLocalFileSystem configures the harness to use the local filesystem for all storage, instead of in-memory versions
UseLocalFileSystem()

// Close closes the harness, freeing up any resources it may have allocated
Close()

Engine() *gms.Engine

Session() *dsess.DoltSession
Expand Down
12 changes: 6 additions & 6 deletions go/libraries/doltcore/sqle/enginetest/dolt_server_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ import (
"testing"
"time"

"github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver"
"github.com/dolthub/dolt/go/libraries/doltcore/dtestutils"
"github.com/dolthub/dolt/go/libraries/doltcore/env"
"github.com/dolthub/dolt/go/libraries/doltcore/servercfg"
"github.com/dolthub/dolt/go/libraries/utils/svcs"
"github.com/dolthub/go-mysql-server/enginetest/queries"
"github.com/dolthub/go-mysql-server/sql"
"github.com/gocraft/dbr/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/dolthub/dolt/go/cmd/dolt/commands/sqlserver"
"github.com/dolthub/dolt/go/libraries/doltcore/dtestutils"
"github.com/dolthub/dolt/go/libraries/doltcore/env"
"github.com/dolthub/dolt/go/libraries/doltcore/servercfg"
"github.com/dolthub/dolt/go/libraries/utils/svcs"
)

// DoltBranchMultiSessionScriptTests contain tests that need to be run in a multi-session server environment
Expand Down Expand Up @@ -680,4 +681,3 @@ func testMultiSessionScriptTests(t *testing.T, tests []queries.ScriptTest) {
})
}
}

0 comments on commit 85956dc

Please sign in to comment.