Files
wehub-resource-sync 5357c39144
Fuzzer / Run Fuzzer (push) Has been cancelled
Race tests / Go race tests (ubuntu-22.04) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:01:40 +08:00

53 lines
1.3 KiB
Bash

#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash
setup() {
setup_no_dolt_init
}
teardown() {
stop_sql_server 1
assert_feature_version
teardown_common
}
@test "clone-drop: clone a database and then drop it" {
mkdir repo
cd repo
dolt init
dolt remote add pushed 'file://../pushed'
dolt push pushed main:main
dolt sql -q 'call dolt_clone("file://../pushed", "cloned"); drop database cloned;'
}
@test "clone-drop: sql-server: clone a database and then drop it" {
mkdir repo
cd repo
dolt init
dolt remote add pushed 'file://../pushed'
dolt push pushed main:main
start_sql_server
dolt sql -q 'call dolt_clone("file://../pushed", "cloned"); drop database cloned;'
}
@test "clone-drop: in-progress marker lifecycle on clone" {
# See https://github.com/dolthub/dolt/issues/11206
mkdir repo
cd repo
dolt init
dolt remote add pushed 'file://../pushed'
dolt push pushed main:main
dolt sql -q 'call dolt_clone("file://../pushed", "cloned");'
[ ! -f cloned/.dolt_safe_to_ignore ]
dolt clone file://../pushed cli_cloned
[ ! -f cli_cloned/.dolt_safe_to_ignore ]
mkdir stuck
touch stuck/.dolt_safe_to_ignore
run dolt sql -q 'call dolt_clone("file://../pushed", "stuck");'
[ "$status" -ne 0 ]
[[ "$output" =~ "incomplete database directory" ]] || false
}