From 6538cbd2edeb2363e205bcddcef47eeefba2521d Mon Sep 17 00:00:00 2001 From: Neil Macneale IV Date: Fri, 16 Jun 2023 14:01:35 -0700 Subject: [PATCH] Remove test which assumes that passing in a arbitrary user to dolt sql is valid Use the common bats setup in import-mysqldump.bats --- integration-tests/bats/import-mysqldump.bats | 6 +----- integration-tests/bats/sql-shell.bats | 22 -------------------- integration-tests/bats/sql.bats | 22 -------------------- 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/integration-tests/bats/import-mysqldump.bats b/integration-tests/bats/import-mysqldump.bats index 683ddc4779..6154efdcde 100644 --- a/integration-tests/bats/import-mysqldump.bats +++ b/integration-tests/bats/import-mysqldump.bats @@ -2,11 +2,7 @@ load $BATS_TEST_DIRNAME/helper/common.bash setup() { - REPO_NAME="dolt_repo_$$" - mkdir $REPO_NAME - cd $REPO_NAME - - dolt init + setup_common } teardown() { diff --git a/integration-tests/bats/sql-shell.bats b/integration-tests/bats/sql-shell.bats index 8c1de66554..8be2eccef5 100644 --- a/integration-tests/bats/sql-shell.bats +++ b/integration-tests/bats/sql-shell.bats @@ -21,28 +21,6 @@ teardown() { teardown_common } -@test "sql-shell: --user option changes superuser" { - # remove config - rm -rf .doltcfg - - # default is root@localhost - run dolt sql <<< "select user, host from mysql.user" - [ "$status" -eq 0 ] - [[ "$output" =~ "root" ]] || false - ! [[ "$output" =~ "dolt" ]] || false - [[ "$output" =~ "localhost" ]] || false - - # make it dolt@localhost - run dolt --user=dolt sql <<< "select user, host from mysql.user" - [ "$status" -eq 0 ] - ! [[ "$output" =~ "root" ]] || false - [[ "$output" =~ "dolt" ]] || false - [[ "$output" =~ "localhost" ]] || false - - # remove config - rm -rf .doltcfg -} - @test "sql-shell: use user without privileges, and no superuser created" { rm -rf .doltcfg diff --git a/integration-tests/bats/sql.bats b/integration-tests/bats/sql.bats index 41f7f8134b..44644fa390 100755 --- a/integration-tests/bats/sql.bats +++ b/integration-tests/bats/sql.bats @@ -39,28 +39,6 @@ teardown() { teardown_common } -@test "sql: --user option changes superuser" { - # remove config - rm -rf .doltcfg - - # default is root@localhost - run dolt sql -q "select user, host from mysql.user" - [ "$status" -eq 0 ] - [[ "$output" =~ "root" ]] || false - ! [[ "$output" =~ "dolt" ]] || false - [[ "$output" =~ "localhost" ]] || false - - # make it dolt@localhost - run dolt --user=dolt sql -q "select user, host from mysql.user" - [ "$status" -eq 0 ] - ! [[ "$output" =~ "root" ]] || false - [[ "$output" =~ "dolt" ]] || false - [[ "$output" =~ "localhost" ]] || false - - # remove config - rm -rf .doltcfg -} - @test "sql: --user don't create superuser if using an existing user" { rm -rf .doltcfg