Merge pull request #747 from liquidata-inc/aaron/bats-remotesrv-pid-handling-change

bats: Change remotesrv pid handling to capture pid of background process.
This commit is contained in:
Aaron Son
2020-06-18 11:40:56 -07:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -3,12 +3,14 @@ load $BATS_TEST_DIRNAME/helper/common.bash
REMOTE=http://localhost:50051/test-org/test-repo
remotesrv_pid=
setup() {
setup_common
cd $BATS_TMPDIR
mkdir remotes-$$
echo remotesrv log available here $BATS_TMPDIR/remotes-$$/remotesrv.log
remotesrv --http-port 1234 --dir ./remotes-$$ &> ./remotes-$$/remotesrv.log 3>&- &
remotesrv_pid=$!
cd dolt-repo-$$
dolt remote add test-remote $REMOTE
dolt push test-remote master
@@ -19,7 +21,7 @@ setup() {
teardown() {
teardown_common
rm -rf $BATS_TMPDIR/git-repo-$$
pgrep remotesrv | xargs kill
kill $remotesrv_pid
rm -rf $BATS_TMPDIR/remotes-$$
}

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash
remotesrv_pid=
setup() {
setup_common
cd $BATS_TMPDIR
@@ -8,18 +9,19 @@ setup() {
mkdir remotes-$$/empty
echo remotesrv log available here $BATS_TMPDIR/remotes-$$/remotesrv.log
remotesrv --http-port 1234 --dir ./remotes-$$ &> ./remotes-$$/remotesrv.log 3>&- &
remotesrv_pid=$!
cd dolt-repo-$$
mkdir "dolt-repo-clones"
}
teardown() {
teardown_common
pgrep remotesrv | xargs kill
kill $remotesrv_pid
rm -rf $BATS_TMPDIR/remotes-$$
}
@test "dolt remotes server is running" {
pgrep remotesrv
ps -p $remotesrv_pid | grep remotesrv
}
@test "add a remote using dolt remote" {