From c562e86c43066dcd197b1ebf9b3efb151fa9bc93 Mon Sep 17 00:00:00 2001 From: Timothy Sehn Date: Mon, 22 Aug 2022 18:24:52 -0700 Subject: [PATCH] Max feedback. Fix test broken by compiling main. --- .../bats/helper/query-server-common.bash | 26 ++++++++++++------- .../bats/remotes-sql-server.bats | 3 +-- integration-tests/bats/sql-server.bats | 4 +-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/integration-tests/bats/helper/query-server-common.bash b/integration-tests/bats/helper/query-server-common.bash index 91242a6106..97a09a33de 100644 --- a/integration-tests/bats/helper/query-server-common.bash +++ b/integration-tests/bats/helper/query-server-common.bash @@ -204,7 +204,11 @@ stop_sql_server() { # executes a query (or list of queries separated by a `;`), # and compares the results against what is expected. # -# If executing multiple queries, separate the expected CSV values with a `;`. +# EXAMPLE: server_query db1 1 dolt "" "select * from test" "c1\n0" +# +# If executing multiple queries, separate the expected CSV values with a `;`. +# +# EXAMPLE: server_query "" 1 dolt "" "use db1; select * from test" ";c1\n0" # # If you expect an exception, leave query results blank and add an additional # value of 1 to the end of the call. This could be improved to actually send @@ -212,17 +216,21 @@ stop_sql_server() { # that. When calling with bats use `run` and then check the $output if you # want to inspect the exception string. # +# EXAMPLE: server_query "" 1 dolt "" "garbage" "" 1 +# # In the event that the results do not match expectations, # the python process will exit with an exit code of 1 # -# * param1 is the database name for the connection string -# * param2 is 1 for autocommit = true, 0 for autocommit = false -# * param3 is the user -# * param4 is the password -# * param5 is the query_str -# * param6 is a csv representing the expected result set. If a query is not expected to have a result set "" should -# be passed. -# * param7 is an expected exception value of 1. Mutually exclusive with param6 +# * param1: The database name for the connection string. +# Leave empy for no database. +# * param2: 1 for autocommit = true, 0 for autocommit = false +# * param3: User +# * param4: Password +# * param5: Query string or query strings separated by `;` +# * param6: A csv representing the expected result set. +# If a query is not expected to have a result set "" should +# be passed. Seprate multiple result sets with `;` +# * param7: Expected exception value of 1. Mutually exclusive with param6. # server_query() { let PORT="$$ % (65536-1024) + 1024" diff --git a/integration-tests/bats/remotes-sql-server.bats b/integration-tests/bats/remotes-sql-server.bats index d9048a3a20..a3e0944b50 100644 --- a/integration-tests/bats/remotes-sql-server.bats +++ b/integration-tests/bats/remotes-sql-server.bats @@ -240,8 +240,7 @@ teardown() { start_sql_server repo2 server_query repo2 1 dolt "" "show tables" "" 1 - [[ "$output" =~ "remote not found: 'unknown'" ]] || false - + [[ "$output" =~ "remote not found: 'unknown'" ]] || false } @test "remotes-sql-server: pull multiple heads, one invalid" { diff --git a/integration-tests/bats/sql-server.bats b/integration-tests/bats/sql-server.bats index 5bba5afcc4..8513dbce0d 100644 --- a/integration-tests/bats/sql-server.bats +++ b/integration-tests/bats/sql-server.bats @@ -1280,12 +1280,12 @@ END""") # can't drop a branch-qualified database name run server_query "" 1 dolt "" "drop database \`test2/newbranch\`" "" 1 - [[ "$output" =~ "database not found" ]] || false + [[ "$output" =~ "unable to drop revision database: test2/newbranch" ]] || false server_query "" 1 dolt "" "drop database TEST2" - server_query "test2/newbranch" 1 dolt "" "select * from a" "" 1 + run server_query "test2/newbranch" 1 dolt "" "select * from a" "" 1 [[ "$output" =~ "database not found" ]] || false server_query "test3" 1 dolt "" "select * from a" "x\n5\n6"