mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-11 02:59:34 -06:00
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:
@@ -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-$$
|
||||
}
|
||||
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user