Merge pull request #1316 from dolthub/db/fix-bats

[no-release-notes] /{.github,bats}: pin runner, add timeouts
This commit is contained in:
Dustin Brown
2021-02-09 17:52:37 -08:00
committed by GitHub
4 changed files with 27 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ ubuntu-18.04, macos-latest, windows-2019 ]
os: [ ubuntu-18.04, macos-10.15, windows-2019 ]
env:
use_credentials: ${{ secrets.AWS_SECRET_ACCESS_KEY != '' && secrets.AWS_ACCESS_KEY_ID != '' }}
steps:

View File

@@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04, windows-latest]
os: [macos-10.15, ubuntu-18.04, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2

View File

@@ -1,38 +1,60 @@
#!/usr/bin/expect
set timeout 1
set timeout 2
spawn dolt sql
expect {
"doltsql> " { send "CREATE TABLE test(pk BIGINT PRIMARY KEY, v1 BIGINT);\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
"doltsql> " { send "INSERT INTO test VALUES (0,0);\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
"doltsql> " { send "DELIMITER $$ ;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
"doltsql> " { send "INSERT INTO test VALUES (1,1)$$\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
"doltsql> " { send "delimiter # $$\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
"doltsql> " { send "CREATE TRIGGER tt BEFORE INSERT ON test FOR EACH ROW\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
" -> " { send "BEGIN\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
" -> " { send "SET NEW.v1 = NEW.v1 * 11;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
" -> " { send "SET NEW.v1 = NEW.v1 * -10;\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
" -> " { send "END; #\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect {
"doltsql> " { send "DeLiMiTeR ; #\r"; }
timeout { exit 1; }
failed { exit 1; }
}
expect eof

View File

@@ -713,8 +713,8 @@ SQL
cd doltsql
dolt init
$BATS_TEST_DIRNAME/sql-delimiter.expect
echo "$output"
run $BATS_TEST_DIRNAME/sql-delimiter.expect
[ "$status" -eq "0" ]
[[ ! "$output" =~ "Error" ]] || false
[[ ! "$output" =~ "error" ]] || false