add remote test for dolt blame

This commit is contained in:
Stephanie You
2023-05-31 17:31:42 -07:00
parent 413bc12da0
commit 76c4b6cdaf
2 changed files with 28 additions and 3 deletions
+2 -3
View File
@@ -137,10 +137,9 @@ SQL
}
@test "blame: returns an error when the table is not found in the given revision" {
skip "SQL views do no support AS OF queries"
run dolt blame HEAD~4 blame_test
[ "$status" -eq 1 ]
[[ "$output" =~ "no table named blame_test found" ]] || false
[ "$status" -eq 0 ]
[[ "$output" = "" ]] || false
}
@test "blame: pk ordered output" {
@@ -108,3 +108,29 @@ teardown() {
[[ "$output" =~ "defaultDB does not exist" ]] || false
}
@test "sql-local-remote: verify dolt blame behavior is identical in switch between server/no server" {
cd defaultDB
dolt sql -q "create table test (pk int primary key)"
dolt sql -q "insert into test values (1)"
dolt add test
dolt commit -m "insert initial value into test"
dolt sql -q "insert into test values (2), (3)"
dolt add test
dolt commit -m "insert more values into test"
start_sql_server defaultDB
run dolt --user dolt blame test
[ "$status" -eq 0 ]
[[ "$output" =~ "1".*"insert initial value into test" ]] || false
[[ "$output" =~ "2".*"insert more values into test" ]] || false
[[ "$output" =~ "3".*"insert more values into test" ]] || false
stop_sql_server 1
run dolt blame test
[ "$status" -eq 0 ]
[[ "$output" =~ "1".*"insert initial value into test" ]] || false
[[ "$output" =~ "2".*"insert more values into test" ]] || false
[[ "$output" =~ "3".*"insert more values into test" ]] || false
}