Fixed/skipped failing bats tests on Windows

This commit is contained in:
Daylon Wilkins
2019-07-17 18:11:56 -07:00
parent 3e11955e7e
commit b13cea0dbd
4 changed files with 57 additions and 2 deletions

View File

@@ -569,7 +569,7 @@ teardown() {
[ "$status" -eq 0 ]
[ "$output" = "Successfully exported data." ]
[ -f export.sql ]
diff $BATS_TEST_DIRNAME/helper/1pk5col-ints.sql export.sql
diff --strip-trailing-cr $BATS_TEST_DIRNAME/helper/1pk5col-ints.sql export.sql
}
@test "dolt schema" {
@@ -608,7 +608,7 @@ teardown() {
[ "$status" -eq 0 ]
[ "$output" = "" ]
[ -f export.schema ]
run diff $BATS_TEST_DIRNAME/helper/1pk5col-ints.schema export.schema
run diff --strip-trailing-cr $BATS_TEST_DIRNAME/helper/1pk5col-ints.schema export.schema
[ "$status" -eq 0 ]
[ "$output" = "" ]
}

View File

@@ -7,6 +7,24 @@ setup() {
export BATS_TMPDIR=$HOME/batstmp/
mkdir $BATS_TMPDIR
fi
skiponwindows() { :; }
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
pkill() {
taskkill -fi "IMAGENAME eq $2*" -f
}
skiponwindows() {
skip "$1"
}
fi
export PATH=$PATH:$GOPATH/bin
export NOMS_VERSION_NEXT=1
@@ -89,6 +107,7 @@ teardown() {
}
@test "git dolt's smudge filter automatically clones dolt repositories referenced in checked out git-dolt pointer files" {
skiponwindows "This test works on Windows command prompt but not the bash terminal: GitHub Issue #1809"
init_git_repo
git dolt install
git dolt link $REMOTE
@@ -138,6 +157,7 @@ teardown() {
}
@test "git dolt fails helpfully when dolt is not installed" {
skiponwindows "This test does not work on Windows: GitHub Issue #1801"
mkdir TMP_PATH
pushd TMP_PATH
which git | xargs ln -sf

View File

@@ -5,6 +5,22 @@ setup() {
export BATS_TMPDIR=$HOME/batstmp/
mkdir $BATS_TMPDIR
fi
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
pkill() {
taskkill -fi "IMAGENAME eq $2*" -f
}
pgrep() {
tasklist -fi "IMAGENAME eq $1*"
}
fi
export PATH=$PATH:~/go/bin
export NOMS_VERSION_NEXT=1

View File

@@ -3,6 +3,22 @@
setup() {
export PATH=$PATH:~/go/bin
export NOMS_VERSION_NEXT=1
skiponwindows() { :; }
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
skiponwindows() {
skip "$1"
}
fi
cd $BATS_TMPDIR
mkdir "dolt-repo-$$"
cd "dolt-repo-$$"
@@ -15,6 +31,7 @@ teardown() {
}
@test "start a sql shell and exit using exit" {
skiponwindows "Works on Windows command prompt but not the MinTTY terminal used during bats"
run bash -c "echo exit | dolt sql"
[ $status -eq 0 ]
[[ "$output" =~ "# Welcome to the DoltSQL shell." ]] || false
@@ -22,6 +39,7 @@ teardown() {
}
@test "start a sql shell and exit using quit" {
skiponwindows "Works on Windows command prompt but not the MinTTY terminal used during bats"
run bash -c "echo quit | dolt sql"
[ $status -eq 0 ]
[[ "$output" =~ "# Welcome to the DoltSQL shell." ]] || false
@@ -29,6 +47,7 @@ teardown() {
}
@test "run a query in sql shell" {
skiponwindows "Works on Windows command prompt but not the MinTTY terminal used during bats"
run bash -c "echo 'select * from test;' | dolt sql"
[ $status -eq 0 ]
[[ "$output" =~ "# Welcome to the DoltSQL shell." ]] || false