bats/remotes-file-system.bats: Update for new clone behavior.

This commit is contained in:
Aaron Son
2020-06-24 12:15:26 -07:00
parent 86b10b5cb6
commit 9ac154cb30
+5 -74
View File
@@ -157,80 +157,11 @@ SQL
dolt clone file://../remote1 test-repo
cd test-repo
run dolt branch
run dolt branch -a
[ "$status" -eq 0 ]
[[ "$output" =~ "master" ]] || false
[[ "$output" =~ "tester" ]] || false
# delete tester branch
dolt branch -d -f tester
run dolt branch
[ "$status" -eq 0 ]
[[ "$output" =~ "master" ]] || false
[[ ! "$output" =~ "tester" ]] || false
}
@test "branches can be deleted after fetch" {
# create a new branch
run dolt checkout -b tester
[ "$status" -eq 0 ]
# demonstrate there is no table named test on tester
run dolt ls
[ "$status" -eq 0 ]
[[ "${lines[0]}" =~ "No tables in working set" ]] || false
# seed tester with some data
dolt sql <<SQL
CREATE TABLE test (
pk BIGINT NOT NULL COMMENT 'tag:0',
c1 BIGINT COMMENT 'tag:1',
c2 BIGINT COMMENT 'tag:2',
c3 BIGINT COMMENT 'tag:3',
c4 BIGINT COMMENT 'tag:4',
c5 BIGINT COMMENT 'tag:5',
PRIMARY KEY (pk)
);
SQL
dolt add test
dolt commit -m "test commit"
# create the remote data storage directories
mkdir remote1
# push both branches to remote
dolt remote add origin file://remote1
dolt push origin tester
dolt checkout master
dolt push origin master
# clone from a directory
cd dolt-repo-clones
dolt clone file://../remote1 test-repo
cd test-repo
run dolt branch
[ "$status" -eq 0 ]
[[ "${lines[0]}" =~ "master" ]] || false
[[ "${lines[1]}" =~ "tester" ]] || false
# delete tester branch
dolt branch -d -f tester
run dolt branch
[ "$status" -eq 0 ]
[[ "${lines[0]}" =~ "master" ]] || false
[[ "${lines[1]}" != "tester" ]] || false
# fetch branches from remote
dolt fetch
# should display both branches fetched from remote
run dolt branch
[ "$status" -eq 0 ]
[[ "${lines[0]}" =~ "master" ]] || false
[[ "$output" =~ "* master" ]] || false
[[ "$output" =~ "remotes/origin/tester" ]] || false
[[ "$output" =~ "remotes/origin/master" ]] || false
}
@test "clone from a directory that is not a dolt repo" {
@@ -241,4 +172,4 @@ SQL
run dolt clone file://../remotedir test-repo
[ "$status" -eq 1 ]
[ ! -d test-repo ]
}
}