mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-18 03:00:33 -06:00
update bats tests
This commit is contained in:
@@ -167,7 +167,7 @@ INSERT INTO test VALUES (0,0,0);
|
||||
CALL dadd('-A');
|
||||
CALL dcommit('-am', 'added table test');
|
||||
SQL
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -am "added a README"
|
||||
|
||||
@@ -178,7 +178,7 @@ SQL
|
||||
[[ "$output" =~ "c0,c1" ]] || false
|
||||
[[ "$output" =~ "0,0" ]] || false
|
||||
|
||||
run dolt docs write README.md
|
||||
run dolt docs print README.md
|
||||
[[ "$output" = $(cat README.md) ]] || false
|
||||
}
|
||||
|
||||
|
||||
@@ -431,9 +431,9 @@ SQL
|
||||
@test "remotes: push and pull with docs from remote" {
|
||||
dolt remote add test-remote http://localhost:50051/test-org/test-repo
|
||||
echo "license-text" > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
echo "readme-text" > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "test doc commit"
|
||||
dolt push test-remote main
|
||||
@@ -448,7 +448,7 @@ SQL
|
||||
|
||||
cd ../../
|
||||
echo "updated-license" > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
dolt commit -m "updated license"
|
||||
dolt push test-remote main
|
||||
@@ -459,7 +459,7 @@ SQL
|
||||
run dolt log
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "updated license" ]] || false
|
||||
dolt docs write LICENSE.md > LICENSE.md
|
||||
dolt docs print LICENSE.md > LICENSE.md
|
||||
run cat LICENSE.md
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "updated-license" ]] || false
|
||||
@@ -626,9 +626,9 @@ SQL
|
||||
@test "remotes: clone a remote with docs" {
|
||||
dolt remote add test-remote http://localhost:50051/test-org/test-repo
|
||||
echo "license-text" > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
echo "readme-text" > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "test doc commit"
|
||||
dolt push test-remote main
|
||||
@@ -644,8 +644,8 @@ SQL
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ! "$output" =~ "LICENSE.md" ]] || false
|
||||
[[ ! "$output" =~ "README.md" ]] || false
|
||||
dolt docs write LICENSE.md > LICENSE.md
|
||||
dolt docs write README.md > README.md
|
||||
dolt docs print LICENSE.md > LICENSE.md
|
||||
dolt docs print README.md > README.md
|
||||
run ls
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "LICENSE.md" ]] || false
|
||||
@@ -843,9 +843,9 @@ SQL
|
||||
@test "remotes: dolt fetch with docs" {
|
||||
# Initial commit of docs on remote
|
||||
echo "initial-license" > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
echo "initial-readme" > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "initial doc commit"
|
||||
dolt remote add test-remote http://localhost:50051/test-org/test-repo
|
||||
@@ -864,8 +864,8 @@ SQL
|
||||
cd "dolt-repo-clones"
|
||||
run dolt clone http://localhost:50051/test-org/test-repo
|
||||
cd test-repo
|
||||
dolt docs write LICENSE.md > LICENSE.md
|
||||
dolt docs write README.md > README.md
|
||||
dolt docs print LICENSE.md > LICENSE.md
|
||||
dolt docs print README.md > README.md
|
||||
run cat LICENSE.md
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "initial-license" ]] || false
|
||||
@@ -874,18 +874,18 @@ SQL
|
||||
[[ "$output" =~ "initial-readme" ]] || false
|
||||
# Change the docs
|
||||
echo "dolt-repo-clones-license" > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
echo "dolt-repo-clones-readme" > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "dolt-repo-clones updated docs"
|
||||
|
||||
# Go back to original repo, and change the docs again
|
||||
cd ../../
|
||||
echo "initial-license-updated" > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
echo "initial-readme-updated" > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "update initial doc values in test-org/test-repo"
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ teardown() {
|
||||
@test "sql-reset: DOLT_RESET --hard does not ignore staged docs" {
|
||||
# New docs gets referred as untracked file.
|
||||
echo ~license~ > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
|
||||
run dolt sql -q "SELECT DOLT_RESET('--hard')"
|
||||
@@ -142,7 +142,7 @@ teardown() {
|
||||
@test "sql-reset: CALL DOLT_RESET --hard does not ignore staged docs" {
|
||||
# New docs gets referred as untracked file.
|
||||
echo ~license~ > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
|
||||
run dolt sql -q "CALL DOLT_RESET('--hard')"
|
||||
@@ -153,11 +153,11 @@ teardown() {
|
||||
[[ "$output" =~ "nothing to commit, working tree clean" ]] || false
|
||||
|
||||
# Tracked file gets reset
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
dolt commit -a -m "Add a the license file"
|
||||
echo ~edited-license~ > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
run dolt sql -q "CALL DOLT_RESET('--hard')"
|
||||
[ $status -eq 0 ]
|
||||
@@ -215,7 +215,7 @@ teardown() {
|
||||
|
||||
@test "sql-reset: DOLT_RESET --soft ignores staged docs" {
|
||||
echo ~license~ > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
|
||||
run dolt sql -q "SELECT DOLT_RESET('--soft')"
|
||||
@@ -228,7 +228,7 @@ teardown() {
|
||||
|
||||
@test "sql-reset: CALL DOLT_RESET --soft ignores staged docs" {
|
||||
echo ~license~ > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
dolt add .
|
||||
|
||||
run dolt sql -q "CALL DOLT_RESET('--soft')"
|
||||
|
||||
@@ -50,9 +50,9 @@ teardown() {
|
||||
|
||||
@test "sql-status: status properly works with docs" {
|
||||
echo readme-text > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
echo license-text > LICENSE.md
|
||||
dolt docs read LICENSE.md LICENSE.md
|
||||
dolt docs upload LICENSE.md LICENSE.md
|
||||
|
||||
dolt sql -r csv -q "select * from dolt_status ORDER BY table_name"
|
||||
run dolt sql -r csv -q "select * from dolt_status ORDER BY table_name"
|
||||
@@ -85,7 +85,7 @@ teardown() {
|
||||
|
||||
@test "sql-status: status works properly with working docs in conflict" {
|
||||
echo "a readme" > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "Committing initial docs"
|
||||
|
||||
@@ -94,17 +94,17 @@ teardown() {
|
||||
|
||||
dolt checkout test-a
|
||||
echo test-a branch > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "Changed README.md on test-a branch"
|
||||
|
||||
dolt checkout test-b
|
||||
run dolt docs write README.md
|
||||
run dolt docs print README.md
|
||||
[[ $output =~ "a readme" ]] || false
|
||||
[[ ! $output =~ "test-a branch" ]] || false
|
||||
|
||||
echo test-b branch > README.md
|
||||
dolt docs read README.md README.md
|
||||
dolt docs upload README.md README.md
|
||||
dolt add .
|
||||
dolt commit -m "Changed README.md on test-a branch"
|
||||
dolt checkout main
|
||||
@@ -113,7 +113,7 @@ teardown() {
|
||||
run dolt merge test-a
|
||||
[ "$status" -eq 0 ]
|
||||
[[ $output =~ "Fast-forward" ]] || false
|
||||
run dolt docs write README.md
|
||||
run dolt docs print README.md
|
||||
[[ "$output" =~ "test-a branch" ]] || false
|
||||
|
||||
# A merge with conflicts does not change the working root.
|
||||
|
||||
Reference in New Issue
Block a user