From 038945d95f3d8fce4647004b166cd882d8aecbcb Mon Sep 17 00:00:00 2001 From: Andy Arthur Date: Tue, 7 Mar 2023 08:19:32 -0800 Subject: [PATCH] integration-test/bats: more file remotes bats fixes --- .../bats/import-create-tables.bats | 1 + integration-tests/bats/remotes.bats | 78 +++++-------------- 2 files changed, 22 insertions(+), 57 deletions(-) diff --git a/integration-tests/bats/import-create-tables.bats b/integration-tests/bats/import-create-tables.bats index b56125fe23..bc878223e3 100755 --- a/integration-tests/bats/import-create-tables.bats +++ b/integration-tests/bats/import-create-tables.bats @@ -588,6 +588,7 @@ DELIM dolt gc AFTER=$(du -c .dolt/noms/ | grep total | sed 's/[^0-9]*//g') + skip "chunk journal doesn't shrink" # less than 10% smaller [ "$BEFORE" -lt $(($AFTER * 11 / 10)) ] } diff --git a/integration-tests/bats/remotes.bats b/integration-tests/bats/remotes.bats index 8489fa6d4b..30af7c494d 100644 --- a/integration-tests/bats/remotes.bats +++ b/integration-tests/bats/remotes.bats @@ -1797,66 +1797,21 @@ setup_ref_test() { dolt push } -@test "remotes: clone local repo with file url" { - mkdir repo1 - cd repo1 - dolt init - dolt commit --allow-empty -am "commit from repo1" - - cd .. - dolt clone file://./repo1/.dolt/noms repo2 - cd repo2 - run dolt log - [[ "$output" =~ "commit from repo1" ]] || false - - run dolt status - [[ "$output" =~ "nothing to commit, working tree clean" ]] || false - - dolt commit --allow-empty -am "commit from repo2" - dolt push - - cd ../repo1 - run dolt log - [[ "$output" =~ "commit from repo1" ]] - [[ "$output" =~ "commit from repo2" ]] -} - -@test "remotes: clone local repo with absolute file path" { - skiponwindows "absolute paths don't work on windows" - mkdir repo1 - cd repo1 - dolt init - dolt commit --allow-empty -am "commit from repo1" - - cd .. - dolt clone file://$(pwd)/repo1/.dolt/noms repo2 - cd repo2 - run dolt log - [[ "$output" =~ "commit from repo1" ]] || false - - run dolt status - [[ "$output" =~ "nothing to commit, working tree clean" ]] || false - - dolt commit --allow-empty -am "commit from repo2" - dolt push - - cd ../repo1 - run dolt log - [[ "$output" =~ "commit from repo1" ]] - [[ "$output" =~ "commit from repo2" ]] -} - @test "remotes: local clone does not contain working set changes" { mkdir repo1 + mkdir rem1 cd repo1 dolt init - run dolt sql -q "create table t (i int)" - [ "$status" -eq 0 ] + dolt sql -q "create table t (i int)" run dolt status [[ "$output" =~ "new table:" ]] || false - + dolt commit -Am "new table" + dolt sql -q "create table t2 (i int)" + dolt remote add rem1 file://../rem1 + dolt push rem1 main cd .. - dolt clone file://./repo1/.dolt/noms repo2 + + dolt clone file://./rem1/ repo2 cd repo2 run dolt status @@ -1865,19 +1820,28 @@ setup_ref_test() { @test "remotes: local clone pushes to other branch" { mkdir repo1 + mkdir rem1 cd repo1 dolt init - + dolt sql -q "create table t (i int)" + run dolt status + [[ "$output" =~ "new table:" ]] || false + dolt commit -Am "new table" + dolt remote add rem1 file://../rem1 + dolt push rem1 main cd .. - dolt clone file://./repo1/.dolt/noms repo2 + + dolt clone file://./rem1/ repo2 cd repo2 dolt checkout -b other - dolt sql -q "create table t (i int)" + dolt sql -q "create table t2 (i int)" dolt add . dolt commit -am "adding table from other" - dolt push origin other + dolt remote add rem1 file://../rem1 + dolt push rem1 other cd ../repo1 + dolt fetch rem1 dolt checkout other run dolt log [[ "$output" =~ "adding table from other" ]]