From 770874a1884953b945a975adbb953e95acfa635a Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 08:06:52 -0600 Subject: [PATCH 01/34] Installing new version of bats --- .github/workflows/gitwatch.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 37bad4c..48ea463 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -22,9 +22,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v3 + - run: sudo npm install -g bats # For the time being, I'm giving up on Super Linter. It's a great tool, # but it's currently broken, and it's taking more time to make it work than From aef672957c154150fd9afcd3d12efecd7ce31302 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 08:09:29 -0600 Subject: [PATCH 02/34] Try again installing updated bats --- .github/workflows/gitwatch.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 48ea463..a165a96 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -25,9 +25,6 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup node - uses: actions/setup-node@v3 - - run: sudo npm install -g bats # For the time being, I'm giving up on Super Linter. It's a great tool, # but it's currently broken, and it's taking more time to make it work than @@ -62,9 +59,11 @@ jobs: timeout-minutes: 5 steps: + - name: Setup node + uses: actions/setup-node@v3 - name: Setup BATS # Even though this says 1.2.0,it's actually using 1.2.1 - uses: mig4/setup-bats@v1.2.0 + run: sudo npm install -g bats - name: Install gitwatch dependencies shell: bash From 55875c8374d6ac7157eff120b9a4c8f6154e03a8 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 08:22:23 -0600 Subject: [PATCH 03/34] trying to diagnose hanging mac --- tests/zcommit.bats | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/zcommit.bats diff --git a/tests/zcommit.bats b/tests/zcommit.bats new file mode 100644 index 0000000..a3ee2ac --- /dev/null +++ b/tests/zcommit.bats @@ -0,0 +1,38 @@ +#!/usr/bin/env bats + +# This is a testscript using the bats testing framework: +# https://github.com/sstephenson/bats +# To run it, at a command prompt: +# bats testscript.bats + +load startup-shutdown + +function zcommit_log_messages_working { #@test + # Start up gitwatch with logging, see if works + "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & + GITWATCH_PID=$! + + # Keeps kill message from printing to screen + disown + + # Create a file, verify that it hasn't been added yet, then commit + cd remote + + # According to inotify documentation, a race condition results if you write + # to directory too soon after it has been created; hence, a short wait. + sleep 1 + echo "line1" >> file1.txt + + # Wait a bit for inotify to figure out the file has changed, and do its add, + # and commit + sleep "$WAITTIME" + + # Make a new change + echo "line2" >> file1.txt + sleep "$WAITTIME" + + # Check commit log that the diff is in there + run git log -1 --oneline + [[ $output == *"file1.txt"* ]] +} + From f2b4b7a70b3a85aa1a4cf0ac60225e08ca548c74 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 08:49:19 -0600 Subject: [PATCH 04/34] hanging mac: trying to echo --- tests/startup-shutdown.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/startup-shutdown.bash b/tests/startup-shutdown.bash index 6c5e186..a699365 100755 --- a/tests/startup-shutdown.bash +++ b/tests/startup-shutdown.bash @@ -20,6 +20,7 @@ setup() { } teardown() { + echo '# Teardown started' >&3 # Remove testing directories # shellcheck disable=SC2164 cd /tmp @@ -29,4 +30,6 @@ teardown() { # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated pkill -15 -P "$GITWATCH_PID" + + echo '# Teardown complete' >&3 } From 1bff25243977b6e4ed53e42d70471f595ea03881 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 08:56:41 -0600 Subject: [PATCH 05/34] try a test step --- .github/workflows/gitwatch.yml | 4 +++- tests/zcommit.bats | 38 ---------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 tests/zcommit.bats diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index a165a96..056ecf5 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -62,7 +62,6 @@ jobs: - name: Setup node uses: actions/setup-node@v3 - name: Setup BATS - # Even though this says 1.2.0,it's actually using 1.2.1 run: sudo npm install -g bats - name: Install gitwatch dependencies @@ -89,3 +88,6 @@ jobs: git config --global user.email "test@email.com" git config --global user.name "test user" bats -rt tests + + - name: Test step + run: echo "Now at test step" diff --git a/tests/zcommit.bats b/tests/zcommit.bats deleted file mode 100644 index a3ee2ac..0000000 --- a/tests/zcommit.bats +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bats - -# This is a testscript using the bats testing framework: -# https://github.com/sstephenson/bats -# To run it, at a command prompt: -# bats testscript.bats - -load startup-shutdown - -function zcommit_log_messages_working { #@test - # Start up gitwatch with logging, see if works - "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & - GITWATCH_PID=$! - - # Keeps kill message from printing to screen - disown - - # Create a file, verify that it hasn't been added yet, then commit - cd remote - - # According to inotify documentation, a race condition results if you write - # to directory too soon after it has been created; hence, a short wait. - sleep 1 - echo "line1" >> file1.txt - - # Wait a bit for inotify to figure out the file has changed, and do its add, - # and commit - sleep "$WAITTIME" - - # Make a new change - echo "line2" >> file1.txt - sleep "$WAITTIME" - - # Check commit log that the diff is in there - run git log -1 --oneline - [[ $output == *"file1.txt"* ]] -} - From 152d28565242ed133685e6f95f9fdf1dde2cda9f Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:01:31 -0600 Subject: [PATCH 06/34] Mac try removing tests --- .github/workflows/gitwatch.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 056ecf5..afdb2de 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -80,14 +80,14 @@ jobs: fi - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Run tests - shell: bash - run: | - git config --global user.email "test@email.com" - git config --global user.name "test user" - bats -rt tests + # - name: Run tests + # shell: bash + # run: | + # git config --global user.email "test@email.com" + # git config --global user.name "test user" + # bats -rt tests - name: Test step run: echo "Now at test step" From 3dcd7c6e62818275b95f85f8f89c6df95d2b4356 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:03:17 -0600 Subject: [PATCH 07/34] just git config back in --- .github/workflows/gitwatch.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index afdb2de..eee7bc2 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -82,11 +82,11 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - # - name: Run tests - # shell: bash - # run: | - # git config --global user.email "test@email.com" - # git config --global user.name "test user" + - name: Run tests + shell: bash + run: | + git config --global user.email "test@email.com" + git config --global user.name "test user" # bats -rt tests - name: Test step From 0eb1394e35f446e02c1c87bc042f8560e1c67e03 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:05:04 -0600 Subject: [PATCH 08/34] now trying to echo when done --- .github/workflows/gitwatch.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index eee7bc2..4eefa97 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -87,7 +87,8 @@ jobs: run: | git config --global user.email "test@email.com" git config --global user.name "test user" - # bats -rt tests + bats -rt tests + echo "Finished running tests" - name: Test step run: echo "Now at test step" From 8ccf2e080ea1f8381910191f770cdebe10c22ab5 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:10:01 -0600 Subject: [PATCH 09/34] try just counting tests --- .github/workflows/gitwatch.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 4eefa97..4e85056 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -87,7 +87,8 @@ jobs: run: | git config --global user.email "test@email.com" git config --global user.name "test user" - bats -rt tests + bats -c tests + #bats -rt tests echo "Finished running tests" - name: Test step From 26cc1b12392cf37d89b68fc24467c846054c333c Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:14:40 -0600 Subject: [PATCH 10/34] trying a simple test --- .github/workflows/gitwatch.yml | 2 +- othertests/tryit.bats | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 othertests/tryit.bats diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 4e85056..a549b3b 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -87,8 +87,8 @@ jobs: run: | git config --global user.email "test@email.com" git config --global user.name "test user" - bats -c tests #bats -rt tests + bats -rt othertests echo "Finished running tests" - name: Test step diff --git a/othertests/tryit.bats b/othertests/tryit.bats new file mode 100644 index 0000000..9f87599 --- /dev/null +++ b/othertests/tryit.bats @@ -0,0 +1,11 @@ +#!/usr/bin/env bats + +# This is a testscript using the bats testing framework: +# https://github.com/sstephenson/bats +# To run it, at a command prompt: +# bats testscript.bats + + +function commit_log_messages_working { #@test + echo "Test complete" +} From 97c5f49e1b6ea5120b72664b37ad3a1f91fa4f43 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:19:03 -0600 Subject: [PATCH 11/34] startup shutdown included --- othertests/tryit.bats | 1 + 1 file changed, 1 insertion(+) diff --git a/othertests/tryit.bats b/othertests/tryit.bats index 9f87599..42050b7 100644 --- a/othertests/tryit.bats +++ b/othertests/tryit.bats @@ -5,6 +5,7 @@ # To run it, at a command prompt: # bats testscript.bats +load startup-shutdown function commit_log_messages_working { #@test echo "Test complete" From 450572230f08ed342e306d9c495272a93da54166 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:21:42 -0600 Subject: [PATCH 12/34] included startup/shutdown --- othertests/startup-shutdown.bash | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 othertests/startup-shutdown.bash diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash new file mode 100755 index 0000000..a699365 --- /dev/null +++ b/othertests/startup-shutdown.bash @@ -0,0 +1,35 @@ +setup() { + # Time to wait for gitwatch to respond + # shellcheck disable=SC2034 + WAITTIME=4 + # Set up directory structure and initialize remote + testdir=$(mktemp -d) + # shellcheck disable=SC2164 + cd "$testdir" + mkdir remote + # shellcheck disable=SC2164 + cd remote + git init -q --bare + # shellcheck disable=SC2103 + cd .. + # shellcheck disable=SC2164 + mkdir local + # shellcheck disable=SC2164 + cd local + git clone -q ../remote +} + +teardown() { + echo '# Teardown started' >&3 + # Remove testing directories + # shellcheck disable=SC2164 + cd /tmp + + # rm -rf $testdir + + # Make sure gitwatch script gets killed if script stopped background + # Must kill the entire tree of processes generated + pkill -15 -P "$GITWATCH_PID" + + echo '# Teardown complete' >&3 +} From 09d9565183cb934ccbfe3325ff392a6b1b829ee9 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:24:57 -0600 Subject: [PATCH 13/34] start test with gitwatch launching --- othertests/tryit.bats | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/othertests/tryit.bats b/othertests/tryit.bats index 42050b7..fc85975 100644 --- a/othertests/tryit.bats +++ b/othertests/tryit.bats @@ -8,5 +8,38 @@ load startup-shutdown function commit_log_messages_working { #@test + # Start up gitwatch with logging, see if works + "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & + GITWATCH_PID=$! + echo "Test complete" } + +# function commit_log_messages_working { #@test +# # Start up gitwatch with logging, see if works +# "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & +# GITWATCH_PID=$! + +# # Keeps kill message from printing to screen +# disown + +# # Create a file, verify that it hasn't been added yet, then commit +# cd remote + +# # According to inotify documentation, a race condition results if you write +# # to directory too soon after it has been created; hence, a short wait. +# sleep 1 +# echo "line1" >> file1.txt + +# # Wait a bit for inotify to figure out the file has changed, and do its add, +# # and commit +# sleep "$WAITTIME" + +# # Make a new change +# echo "line2" >> file1.txt +# sleep "$WAITTIME" + +# # Check commit log that the diff is in there +# run git log -1 --oneline +# [[ $output == *"file1.txt"* ]] +# } From a2dc46413d89b325d2f34a275e0f59ff5871bf7c Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:26:43 -0600 Subject: [PATCH 14/34] fixed bad function line --- othertests/tryit.bats | 1 - 1 file changed, 1 deletion(-) diff --git a/othertests/tryit.bats b/othertests/tryit.bats index fc85975..de1b577 100644 --- a/othertests/tryit.bats +++ b/othertests/tryit.bats @@ -15,7 +15,6 @@ function commit_log_messages_working { #@test echo "Test complete" } -# function commit_log_messages_working { #@test # # Start up gitwatch with logging, see if works # "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & # GITWATCH_PID=$! From e639ce29b97a2a8dfa07a31b5a5afd3e0ed0cfee Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:31:58 -0600 Subject: [PATCH 15/34] see if a kill -9 does the trick on Mac --- othertests/startup-shutdown.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index a699365..29b2b9b 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -29,7 +29,7 @@ teardown() { # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated - pkill -15 -P "$GITWATCH_PID" + pkill -9 -P "$GITWATCH_PID" echo '# Teardown complete' >&3 } From c558fc9db4909487f2a5d3e33b9ba22584004df8 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:37:50 -0600 Subject: [PATCH 16/34] printing process id --- othertests/startup-shutdown.bash | 1 + othertests/tryit.bats | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index 29b2b9b..97f2e82 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -27,6 +27,7 @@ teardown() { # rm -rf $testdir + echo "Process id again $GITWATCH_PID" >&3 # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated pkill -9 -P "$GITWATCH_PID" diff --git a/othertests/tryit.bats b/othertests/tryit.bats index de1b577..30c8c4c 100644 --- a/othertests/tryit.bats +++ b/othertests/tryit.bats @@ -12,7 +12,8 @@ function commit_log_messages_working { #@test "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & GITWATCH_PID=$! - echo "Test complete" + echo "Process id $GITWATCH_PID" >&3 + echo "Test complete" >&3 } # # Start up gitwatch with logging, see if works From d580ff0f90377e43870fc0c3181c74295de38203 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 09:43:19 -0600 Subject: [PATCH 17/34] try enabling ssh to debug --- .github/workflows/gitwatch.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index a549b3b..4ec431e 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -82,6 +82,9 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Setup upterm session + uses: lhotari/action-upterm@v1 + - name: Run tests shell: bash run: | From f03dabbeb0130338a383ca7a252d6b14d1b41220 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:04:34 -0600 Subject: [PATCH 18/34] fswatch kill in --- othertests/startup-shutdown.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index 97f2e82..c960d75 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -30,7 +30,9 @@ teardown() { echo "Process id again $GITWATCH_PID" >&3 # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated - pkill -9 -P "$GITWATCH_PID" + pkill -15 -P "$GITWATCH_PID" + # Also make sure to kill fswatch if on Mac + killall fswatch echo '# Teardown complete' >&3 } From f751f423d0533ff28a5e592c3c3f801a2542717d Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:06:35 -0600 Subject: [PATCH 19/34] removed upterm --- .github/workflows/gitwatch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 4ec431e..5bab280 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -82,8 +82,8 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Setup upterm session - uses: lhotari/action-upterm@v1 + # - name: Setup upterm session + # uses: lhotari/action-upterm@v1 - name: Run tests shell: bash From 351d2438842a4d721a34ec07465b2757463615be Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:11:03 -0600 Subject: [PATCH 20/34] trying a killall -9 --- othertests/startup-shutdown.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index c960d75..2557f89 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -32,7 +32,7 @@ teardown() { # Must kill the entire tree of processes generated pkill -15 -P "$GITWATCH_PID" # Also make sure to kill fswatch if on Mac - killall fswatch + killall -9 fswatch echo '# Teardown complete' >&3 } From 532cae8610d1f27ebf2ed08ea55bdcac23a17df0 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:14:36 -0600 Subject: [PATCH 21/34] ssh back in again to try to figure out why not --- .github/workflows/gitwatch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 5bab280..4ec431e 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -82,8 +82,8 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - # - name: Setup upterm session - # uses: lhotari/action-upterm@v1 + - name: Setup upterm session + uses: lhotari/action-upterm@v1 - name: Run tests shell: bash From 05c9450fd3ae8ee0ea46913be640bc6e02b0e37a Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:23:53 -0600 Subject: [PATCH 22/34] reordered fswatch kill --- .github/workflows/gitwatch.yml | 4 ++-- othertests/startup-shutdown.bash | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 4ec431e..5bab280 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -82,8 +82,8 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Setup upterm session - uses: lhotari/action-upterm@v1 + # - name: Setup upterm session + # uses: lhotari/action-upterm@v1 - name: Run tests shell: bash diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index 2557f89..db3435d 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -29,10 +29,10 @@ teardown() { echo "Process id again $GITWATCH_PID" >&3 # Make sure gitwatch script gets killed if script stopped background + # Also make sure to kill fswatch if on Mac + killall fswatch # Must kill the entire tree of processes generated pkill -15 -P "$GITWATCH_PID" - # Also make sure to kill fswatch if on Mac - killall -9 fswatch echo '# Teardown complete' >&3 } From 25d82797c5b7950eead750d082b97016cdf208bd Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:34:22 -0600 Subject: [PATCH 23/34] try with fix from bats site --- othertests/startup-shutdown.bash | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index db3435d..d8af688 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -19,6 +19,17 @@ setup() { git clone -q ../remote } +function close_non_std_fds() { + local open_fds non_std_fds=() + get_open_fds + for fd in "${open_fds[@]}"; do + if [[ $fd -gt 2 ]]; then + non_std_fds+=("$fd") + fi + done + close_fds "${non_std_fds[@]}" +} + teardown() { echo '# Teardown started' >&3 # Remove testing directories @@ -34,5 +45,8 @@ teardown() { # Must kill the entire tree of processes generated pkill -15 -P "$GITWATCH_PID" + close_non_std_fds + echo '# Teardown complete' >&3 + } From b24bf2c4c42e6f135d5f4b8e5faf1ff5e392aa69 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:39:29 -0600 Subject: [PATCH 24/34] yet another attempt --- othertests/startup-shutdown.bash | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash index d8af688..9fa14b0 100755 --- a/othertests/startup-shutdown.bash +++ b/othertests/startup-shutdown.bash @@ -19,17 +19,6 @@ setup() { git clone -q ../remote } -function close_non_std_fds() { - local open_fds non_std_fds=() - get_open_fds - for fd in "${open_fds[@]}"; do - if [[ $fd -gt 2 ]]; then - non_std_fds+=("$fd") - fi - done - close_fds "${non_std_fds[@]}" -} - teardown() { echo '# Teardown started' >&3 # Remove testing directories @@ -39,6 +28,11 @@ teardown() { # rm -rf $testdir echo "Process id again $GITWATCH_PID" >&3 + + # Try killing background process + kill -9 %1 + fg + # Make sure gitwatch script gets killed if script stopped background # Also make sure to kill fswatch if on Mac killall fswatch From ab9e5d70bcc3c13d57d917ee35b8626bc8944150 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:44:27 -0600 Subject: [PATCH 25/34] tests back in --- .github/workflows/gitwatch.yml | 4 ++-- tests/startup-shutdown.bash | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gitwatch.yml b/.github/workflows/gitwatch.yml index 5bab280..3c2d9a8 100644 --- a/.github/workflows/gitwatch.yml +++ b/.github/workflows/gitwatch.yml @@ -90,8 +90,8 @@ jobs: run: | git config --global user.email "test@email.com" git config --global user.name "test user" - #bats -rt tests - bats -rt othertests + bats -rt tests + #bats -rt othertests echo "Finished running tests" - name: Test step diff --git a/tests/startup-shutdown.bash b/tests/startup-shutdown.bash index a699365..54e4014 100755 --- a/tests/startup-shutdown.bash +++ b/tests/startup-shutdown.bash @@ -25,7 +25,9 @@ teardown() { # shellcheck disable=SC2164 cd /tmp - # rm -rf $testdir + # Kill background process + kill -9 %1 + fg # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated From 02377d857a58fd8a7bcd4d6698d073c8feb6ea92 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 10:48:52 -0600 Subject: [PATCH 26/34] trying again --- tests/startup-shutdown.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/startup-shutdown.bash b/tests/startup-shutdown.bash index 54e4014..d141047 100755 --- a/tests/startup-shutdown.bash +++ b/tests/startup-shutdown.bash @@ -29,6 +29,8 @@ teardown() { kill -9 %1 fg + # Also make sure to kill fswatch if on Mac + killall fswatch # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated pkill -15 -P "$GITWATCH_PID" From e6d61cdb14c6919c7abbebde95bcb0f4e08c1778 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 11:02:13 -0600 Subject: [PATCH 27/34] try new test for spaces --- tests/spaces.bats | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tests/spaces.bats diff --git a/tests/spaces.bats b/tests/spaces.bats new file mode 100644 index 0000000..7d5e2d9 --- /dev/null +++ b/tests/spaces.bats @@ -0,0 +1,67 @@ +#!/usr/bin/env bats + +function spaces_in_target_dir { #@test + # Time to wait for gitwatch to respond + # shellcheck disable=SC2034 + WAITTIME=4 + # Set up directory structure and initialize remote + testdir=$(mktemp -d "/tmp/tmp space.XXXXXXX") + # shellcheck disable=SC2164 + cd "$testdir" + mkdir remote + # shellcheck disable=SC2164 + cd remote + git init -q --bare + # shellcheck disable=SC2103 + cd .. + # shellcheck disable=SC2164 + mkdir local + # shellcheck disable=SC2164 + cd local + git clone -q ../remote + + # Start up gitwatch with logging, see if works + "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & + GITWATCH_PID=$! + + # Keeps kill message from printing to screen + disown + + # Create a file, verify that it hasn't been added yet, then commit + cd remote + + # According to inotify documentation, a race condition results if you write + # to directory too soon after it has been created; hence, a short wait. + sleep 1 + echo "line1" >> file1.txt + + # Wait a bit for inotify to figure out the file has changed, and do its add, + # and commit + sleep "$WAITTIME" + + # Make a new change + echo "line2" >> file1.txt + sleep "$WAITTIME" + + # Check commit log that the diff is in there + run git log -1 --oneline + [[ $output == *"file1.txt"* ]] + + echo '# Teardown started' >&3 + # Remove testing directories + # shellcheck disable=SC2164 + cd /tmp + + # Kill background process + kill -9 %1 + fg + + # Also make sure to kill fswatch if on Mac + killall fswatch + # Make sure gitwatch script gets killed if script stopped background + # Must kill the entire tree of processes generated + pkill -15 -P "$GITWATCH_PID" + + echo '# Teardown complete' >&3 +} + From dd8164a0a99fd44991260860966605dd45ba276c Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 11:26:00 -0600 Subject: [PATCH 28/34] trying again --- tests/spaces.bats | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/tests/spaces.bats b/tests/spaces.bats index 7d5e2d9..f5c7566 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -23,6 +23,7 @@ function spaces_in_target_dir { #@test # Start up gitwatch with logging, see if works "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & GITWATCH_PID=$! + echo "$GITWATCH_PID" # Keeps kill message from printing to screen disown @@ -30,22 +31,22 @@ function spaces_in_target_dir { #@test # Create a file, verify that it hasn't been added yet, then commit cd remote - # According to inotify documentation, a race condition results if you write - # to directory too soon after it has been created; hence, a short wait. - sleep 1 - echo "line1" >> file1.txt + # # According to inotify documentation, a race condition results if you write + # # to directory too soon after it has been created; hence, a short wait. + # sleep 1 + # echo "line1" >> file1.txt - # Wait a bit for inotify to figure out the file has changed, and do its add, - # and commit - sleep "$WAITTIME" + # # Wait a bit for inotify to figure out the file has changed, and do its add, + # # and commit + # sleep "$WAITTIME" - # Make a new change - echo "line2" >> file1.txt - sleep "$WAITTIME" + # # Make a new change + # echo "line2" >> file1.txt + # sleep "$WAITTIME" - # Check commit log that the diff is in there - run git log -1 --oneline - [[ $output == *"file1.txt"* ]] + # # Check commit log that the diff is in there + # run git log -1 --oneline + # [[ $output == *"file1.txt"* ]] echo '# Teardown started' >&3 # Remove testing directories @@ -53,14 +54,16 @@ function spaces_in_target_dir { #@test cd /tmp # Kill background process - kill -9 %1 - fg + # kill -9 %1 + # fg # Also make sure to kill fswatch if on Mac - killall fswatch + killall fswatch || true # Make sure gitwatch script gets killed if script stopped background # Must kill the entire tree of processes generated - pkill -15 -P "$GITWATCH_PID" + pkill -15 -f gitwatch.sh + pkill -15 -f gitwatch.sh + # pkill -15 -P "$GITWATCH_PID" echo '# Teardown complete' >&3 } From 641230668fbda2362855933634dcb827df57dc18 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 11:29:54 -0600 Subject: [PATCH 29/34] cleaned up test, looks good --- othertests/startup-shutdown.bash | 46 -------------------------------- othertests/tryit.bats | 45 ------------------------------- tests/spaces.bats | 19 ++----------- 3 files changed, 2 insertions(+), 108 deletions(-) delete mode 100755 othertests/startup-shutdown.bash delete mode 100644 othertests/tryit.bats diff --git a/othertests/startup-shutdown.bash b/othertests/startup-shutdown.bash deleted file mode 100755 index 9fa14b0..0000000 --- a/othertests/startup-shutdown.bash +++ /dev/null @@ -1,46 +0,0 @@ -setup() { - # Time to wait for gitwatch to respond - # shellcheck disable=SC2034 - WAITTIME=4 - # Set up directory structure and initialize remote - testdir=$(mktemp -d) - # shellcheck disable=SC2164 - cd "$testdir" - mkdir remote - # shellcheck disable=SC2164 - cd remote - git init -q --bare - # shellcheck disable=SC2103 - cd .. - # shellcheck disable=SC2164 - mkdir local - # shellcheck disable=SC2164 - cd local - git clone -q ../remote -} - -teardown() { - echo '# Teardown started' >&3 - # Remove testing directories - # shellcheck disable=SC2164 - cd /tmp - - # rm -rf $testdir - - echo "Process id again $GITWATCH_PID" >&3 - - # Try killing background process - kill -9 %1 - fg - - # Make sure gitwatch script gets killed if script stopped background - # Also make sure to kill fswatch if on Mac - killall fswatch - # Must kill the entire tree of processes generated - pkill -15 -P "$GITWATCH_PID" - - close_non_std_fds - - echo '# Teardown complete' >&3 - -} diff --git a/othertests/tryit.bats b/othertests/tryit.bats deleted file mode 100644 index 30c8c4c..0000000 --- a/othertests/tryit.bats +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bats - -# This is a testscript using the bats testing framework: -# https://github.com/sstephenson/bats -# To run it, at a command prompt: -# bats testscript.bats - -load startup-shutdown - -function commit_log_messages_working { #@test - # Start up gitwatch with logging, see if works - "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & - GITWATCH_PID=$! - - echo "Process id $GITWATCH_PID" >&3 - echo "Test complete" >&3 -} - -# # Start up gitwatch with logging, see if works -# "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & -# GITWATCH_PID=$! - -# # Keeps kill message from printing to screen -# disown - -# # Create a file, verify that it hasn't been added yet, then commit -# cd remote - -# # According to inotify documentation, a race condition results if you write -# # to directory too soon after it has been created; hence, a short wait. -# sleep 1 -# echo "line1" >> file1.txt - -# # Wait a bit for inotify to figure out the file has changed, and do its add, -# # and commit -# sleep "$WAITTIME" - -# # Make a new change -# echo "line2" >> file1.txt -# sleep "$WAITTIME" - -# # Check commit log that the diff is in there -# run git log -1 --oneline -# [[ $output == *"file1.txt"* ]] -# } diff --git a/tests/spaces.bats b/tests/spaces.bats index f5c7566..f9b6f8c 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -1,5 +1,7 @@ #!/usr/bin/env bats +# This inserts customs setup and teardown because of spaces in the file name + function spaces_in_target_dir { #@test # Time to wait for gitwatch to respond # shellcheck disable=SC2034 @@ -31,23 +33,6 @@ function spaces_in_target_dir { #@test # Create a file, verify that it hasn't been added yet, then commit cd remote - # # According to inotify documentation, a race condition results if you write - # # to directory too soon after it has been created; hence, a short wait. - # sleep 1 - # echo "line1" >> file1.txt - - # # Wait a bit for inotify to figure out the file has changed, and do its add, - # # and commit - # sleep "$WAITTIME" - - # # Make a new change - # echo "line2" >> file1.txt - # sleep "$WAITTIME" - - # # Check commit log that the diff is in there - # run git log -1 --oneline - # [[ $output == *"file1.txt"* ]] - echo '# Teardown started' >&3 # Remove testing directories # shellcheck disable=SC2164 From 910f143505608bd0107509637ccbfce05ed83863 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 11:38:56 -0600 Subject: [PATCH 30/34] take space out to make sure tests pass --- tests/spaces.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spaces.bats b/tests/spaces.bats index f9b6f8c..8c7cd15 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -7,7 +7,7 @@ function spaces_in_target_dir { #@test # shellcheck disable=SC2034 WAITTIME=4 # Set up directory structure and initialize remote - testdir=$(mktemp -d "/tmp/tmp space.XXXXXXX") + testdir=$(mktemp -d "/tmp/tmpspace.XXXXXXX") # shellcheck disable=SC2164 cd "$testdir" mkdir remote From 0bbf2b584834915711e202fdcad0574ba7ed7b8a Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 11:57:38 -0600 Subject: [PATCH 31/34] new approach for trying to dup space bug --- tests/spaces.bats | 50 +++++++++--------------------- tests/startup-shutdown-spaces.bash | 41 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 35 deletions(-) create mode 100755 tests/startup-shutdown-spaces.bash diff --git a/tests/spaces.bats b/tests/spaces.bats index 8c7cd15..510b663 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -2,30 +2,12 @@ # This inserts customs setup and teardown because of spaces in the file name -function spaces_in_target_dir { #@test - # Time to wait for gitwatch to respond - # shellcheck disable=SC2034 - WAITTIME=4 - # Set up directory structure and initialize remote - testdir=$(mktemp -d "/tmp/tmpspace.XXXXXXX") - # shellcheck disable=SC2164 - cd "$testdir" - mkdir remote - # shellcheck disable=SC2164 - cd remote - git init -q --bare - # shellcheck disable=SC2103 - cd .. - # shellcheck disable=SC2164 - mkdir local - # shellcheck disable=SC2164 - cd local - git clone -q ../remote +load startup-shutdown-spaces +function spaces_in_target_dir { #@test # Start up gitwatch with logging, see if works "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & GITWATCH_PID=$! - echo "$GITWATCH_PID" # Keeps kill message from printing to screen disown @@ -33,23 +15,21 @@ function spaces_in_target_dir { #@test # Create a file, verify that it hasn't been added yet, then commit cd remote - echo '# Teardown started' >&3 - # Remove testing directories - # shellcheck disable=SC2164 - cd /tmp + # According to inotify documentation, a race condition results if you write + # to directory too soon after it has been created; hence, a short wait. + sleep 1 + echo "line1" >> file1.txt - # Kill background process - # kill -9 %1 - # fg + # Wait a bit for inotify to figure out the file has changed, and do its add, + # and commit + sleep "$WAITTIME" - # Also make sure to kill fswatch if on Mac - killall fswatch || true - # Make sure gitwatch script gets killed if script stopped background - # Must kill the entire tree of processes generated - pkill -15 -f gitwatch.sh - pkill -15 -f gitwatch.sh - # pkill -15 -P "$GITWATCH_PID" + # Make a new change + echo "line2" >> file1.txt + sleep "$WAITTIME" - echo '# Teardown complete' >&3 + # Check commit log that the diff is in there + run git log -1 --oneline + [[ $output == *"file1.txt"* ]] } diff --git a/tests/startup-shutdown-spaces.bash b/tests/startup-shutdown-spaces.bash new file mode 100755 index 0000000..82c21fe --- /dev/null +++ b/tests/startup-shutdown-spaces.bash @@ -0,0 +1,41 @@ +# This inserts customs setup and teardown because of spaces in the file name + +setup() { + # Time to wait for gitwatch to respond + # shellcheck disable=SC2034 + WAITTIME=4 + # Set up directory structure and initialize remote + testdir=$(mktemp -d "/tmp/tmp space.XXXXXXX") + # shellcheck disable=SC2164 + cd "$testdir" + mkdir remote + # shellcheck disable=SC2164 + cd remote + git init -q --bare + # shellcheck disable=SC2103 + cd .. + # shellcheck disable=SC2164 + mkdir local + # shellcheck disable=SC2164 + cd local + git clone -q ../remote +} + +teardown() { + echo '# Teardown started' >&3 + # Remove testing directories + # shellcheck disable=SC2164 + cd /tmp + + # Kill background process + kill -9 %1 + fg + + # Also make sure to kill fswatch if on Mac + killall fswatch + # Make sure gitwatch script gets killed if script stopped background + # Must kill the entire tree of processes generated + pkill -15 -P "$GITWATCH_PID" + + echo '# Teardown complete' >&3 +} From 8e884278134326d9fdee2cc214cfa65f84d800f7 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 12:02:46 -0600 Subject: [PATCH 32/34] spaces back in --- tests/spaces.bats | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/spaces.bats b/tests/spaces.bats index 510b663..266a1ca 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -7,6 +7,7 @@ load startup-shutdown-spaces function spaces_in_target_dir { #@test # Start up gitwatch with logging, see if works "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & + echo "Testdir: $testdir" >&3 GITWATCH_PID=$! # Keeps kill message from printing to screen From d757ac2f213be98fdb5d12b4004d58d0149219a8 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 12:12:23 -0600 Subject: [PATCH 33/34] yet again trying spaces --- tests/spaces.bats | 4 ++-- tests/startup-shutdown-spaces.bash | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/spaces.bats b/tests/spaces.bats index 266a1ca..db8726d 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -6,7 +6,7 @@ load startup-shutdown-spaces function spaces_in_target_dir { #@test # Start up gitwatch with logging, see if works - "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote" 3>&- & + "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote with spaces" 3>&- & echo "Testdir: $testdir" >&3 GITWATCH_PID=$! @@ -14,7 +14,7 @@ function spaces_in_target_dir { #@test disown # Create a file, verify that it hasn't been added yet, then commit - cd remote + cd "remote with spaces" # According to inotify documentation, a race condition results if you write # to directory too soon after it has been created; hence, a short wait. diff --git a/tests/startup-shutdown-spaces.bash b/tests/startup-shutdown-spaces.bash index 82c21fe..a8856cd 100755 --- a/tests/startup-shutdown-spaces.bash +++ b/tests/startup-shutdown-spaces.bash @@ -5,7 +5,7 @@ setup() { # shellcheck disable=SC2034 WAITTIME=4 # Set up directory structure and initialize remote - testdir=$(mktemp -d "/tmp/tmp space.XXXXXXX") + testdir=$(mktemp -d) # shellcheck disable=SC2164 cd "$testdir" mkdir remote @@ -18,7 +18,7 @@ setup() { mkdir local # shellcheck disable=SC2164 cd local - git clone -q ../remote + git clone -q ../remote "remote with spaces" } teardown() { From 06fdc07206c03befb9ecb30ed9b65952db62e4f6 Mon Sep 17 00:00:00 2001 From: "Dave Musicant (home machine)" Date: Sun, 4 Dec 2022 12:26:11 -0600 Subject: [PATCH 34/34] one more try --- tests/spaces.bats | 4 ++-- tests/startup-shutdown-spaces.bash | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/spaces.bats b/tests/spaces.bats index db8726d..09e90e8 100644 --- a/tests/spaces.bats +++ b/tests/spaces.bats @@ -6,7 +6,7 @@ load startup-shutdown-spaces function spaces_in_target_dir { #@test # Start up gitwatch with logging, see if works - "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/remote with spaces" 3>&- & + "${BATS_TEST_DIRNAME}"/../gitwatch.sh -l 10 "$testdir/local/rem with spaces" 3>&- & echo "Testdir: $testdir" >&3 GITWATCH_PID=$! @@ -14,7 +14,7 @@ function spaces_in_target_dir { #@test disown # Create a file, verify that it hasn't been added yet, then commit - cd "remote with spaces" + cd "rem with spaces" # According to inotify documentation, a race condition results if you write # to directory too soon after it has been created; hence, a short wait. diff --git a/tests/startup-shutdown-spaces.bash b/tests/startup-shutdown-spaces.bash index a8856cd..dbfecb9 100755 --- a/tests/startup-shutdown-spaces.bash +++ b/tests/startup-shutdown-spaces.bash @@ -5,7 +5,7 @@ setup() { # shellcheck disable=SC2034 WAITTIME=4 # Set up directory structure and initialize remote - testdir=$(mktemp -d) + testdir=$(mktemp -d "/tmp/temp space.XXXXX") # shellcheck disable=SC2164 cd "$testdir" mkdir remote @@ -18,7 +18,7 @@ setup() { mkdir local # shellcheck disable=SC2164 cd local - git clone -q ../remote "remote with spaces" + git clone -q ../remote "rem with spaces" } teardown() {