mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-21 19:39:04 -05:00
Initial implementation of automatic testing with local remote server.
This commit is contained in:
@@ -22,10 +22,13 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ ubuntu-22.04, macos-latest ]
|
||||
start_sql_server: [ true, false ]
|
||||
env:
|
||||
use_credentials: ${{ secrets.AWS_SECRET_ACCESS_KEY != '' && secrets.AWS_ACCESS_KEY_ID != '' }}
|
||||
steps:
|
||||
- name: Conditionally Set ENV VARS for AWS tests
|
||||
env:
|
||||
START_SQL_SERVER: ${{ matrix.start_sql_server }}
|
||||
run: |
|
||||
if [[ $use_credentials == true ]]; then
|
||||
echo "AWS_SDK_LOAD_CONFIG=1" >> $GITHUB_ENV
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
load helper/windows-compat
|
||||
load helper/local-remote
|
||||
|
||||
if [ -z "$BATS_TMPDIR" ]; then
|
||||
export BATS_TMPDIR=$HOME/batstmp/
|
||||
@@ -77,6 +78,7 @@ skip_nbf_dolt() {
|
||||
setup_common() {
|
||||
setup_no_dolt_init
|
||||
dolt init
|
||||
setup_remote_server
|
||||
}
|
||||
|
||||
teardown_common() {
|
||||
@@ -85,6 +87,7 @@ teardown_common() {
|
||||
# any processes to finish, we just ignore any error removing temp files and use 'true' as the last
|
||||
# command in this function to ensure that teardown_common doesn't fail a test just because we
|
||||
# couldn't delete any temporary test files.
|
||||
teardown_remote_server
|
||||
rm -rf "$BATS_TMPDIR/dolt-repo-$$"
|
||||
true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
SKIP_SERVER_TESTS=(
|
||||
|
||||
)
|
||||
|
||||
setup_remote_server() {
|
||||
script_name = $(basename $BASH_SOURCE)
|
||||
if [ "$START_SQL_SERVER" = $true ];
|
||||
then
|
||||
if [ echo "$SKIP_SERVER_TESTS" | grep "$script_name" ];
|
||||
then
|
||||
skip
|
||||
else
|
||||
start_sql_server
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
teardown_remote_server() {
|
||||
if [ "$START_SQL_SERVER" = $true ];
|
||||
then
|
||||
stop_sql_server
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user