-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89c00fe
commit ba6877b
Showing
2 changed files
with
24 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,56 +3,48 @@ load $BATS_TEST_DIRNAME/setup/common.bash | |
|
||
setup() { | ||
setup_common | ||
# dolt config was being used to create a new doltgres database | ||
# so unset user name and email for testing | ||
dolt config --global --unset user.name | ||
dolt config --global --unset user.email | ||
} | ||
|
||
teardown() { | ||
dolt config --global --add user.name "Bats Tests" | ||
dolt config --global --add user.email "[email protected]" | ||
teardown_common | ||
} | ||
|
||
@test 'doltgres: no args' { | ||
export DOLTGRES_DATA_DIR= | ||
start_sql_server_with_args "--host 0.0.0.0" | ||
run query_server -c "\l" | ||
[ "$status" -eq 0 ] | ||
[[ "$output" =~ "information_schema" ]] || false | ||
[[ "$output" =~ "doltgres" ]] || false | ||
[[ "$output" =~ "postgres" ]] || false | ||
|
||
@test 'doltgres: DOLTGRES_DATA_DIR set to current dir' { | ||
[ ! -d "doltgres" ] | ||
} | ||
|
||
@test 'doltgres: with --data-dir' { | ||
export DOLTGRES_DATA_DIR= | ||
start_sql_server_with_args "--host 0.0.0.0" "--data-dir=." | ||
run query_server -c "\l" | ||
[ "$status" -eq 0 ] | ||
[[ "$output" =~ "information_schema" ]] || false | ||
[[ "$output" =~ "doltgres" ]] || false | ||
export SQL_USER="doltgres" | ||
start_sql_server_with_args "--host 0.0.0.0" "--user doltgres" > log.txt 2>&1 | ||
|
||
run cat log.txt | ||
[[ ! "$output" =~ "Author identity unknown" ]] || false | ||
[ -d "doltgres" ] | ||
} | ||
|
||
@test 'doltgres: with DOLTGRES_DATA_DIR' { | ||
export DOLTGRES_DATA_DIR="$(pwd)/test" | ||
start_sql_server_with_args "--host 0.0.0.0" | ||
run query_server -c "\l" | ||
[ "$status" -eq 0 ] | ||
[[ "$output" =~ "information_schema" ]] || false | ||
[[ "$output" =~ "doltgres" ]] || false | ||
[[ "$output" =~ "postgres" ]] || false | ||
} | ||
|
||
[ -d "test/doltgres" ] | ||
@test 'doltgres: setting both --data-dir and DOLTGRES_DATA_DIR should use --data-dir value' { | ||
[ ! -d "doltgres" ] | ||
} | ||
|
||
@test 'doltgres: with both --data-dir and DOLTGRES_DATA_DIR' { | ||
export DOLTGRES_DATA_DIR="$(pwd)/test1" | ||
start_sql_server_with_args "--host 0.0.0.0" "--data-dir=./test2" | ||
export SQL_USER="doltgres" | ||
start_sql_server_with_args "--host 0.0.0.0" "--user doltgres" "--data-dir=./test" > log.txt 2>&1 | ||
|
||
run cat log.txt | ||
[[ ! "$output" =~ "Author identity unknown" ]] || false | ||
[ ! -d "doltgres" ] | ||
[ -d "test/doltgres" ] | ||
|
||
run query_server -c "\l" | ||
[ "$status" -eq 0 ] | ||
[[ "$output" =~ "information_schema" ]] || false | ||
[[ "$output" =~ "doltgres" ]] || false | ||
[[ "$output" =~ "postgres" ]] || false | ||
|
||
[ -d "test2/doltgres" ] | ||
[ ! -d "test1/doltgres" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters