Skip to content

Commit ce86f6b

Browse files
committed
fix
1 parent 89316aa commit ce86f6b

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

rewatch/tests/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cd ../testrepo
55

66
bold "Test: It should compile"
77

8-
if rewatch clean ;
8+
if rewatch clean &> /dev/null;
99
then
1010
success "Repo Cleaned"
1111
else

rewatch/tests/lock.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,20 @@ else
1414
fi
1515

1616
exit_watcher() {
17-
# we need to kill the parent process (rewatch)
18-
kill $(pgrep -P $!);
17+
# Try to find parent process, if not found just kill the process directly
18+
PARENT_PROCS=$(pgrep -P $!)
19+
if [ -n "$PARENT_PROCS" ]; then
20+
kill $PARENT_PROCS &>/dev/null
21+
fi
22+
# for if it's the node script that runs rewatch also kill the child processes
23+
CHILD_PROCS=$(pgrep -f rewatch)
24+
if [ -n "$CHILD_PROCS" ]; then
25+
kill $! &>/dev/null
26+
kill $CHILD_PROCS &>/dev/null
27+
else
28+
# Last resort: just kill the background process
29+
kill $!
30+
fi
1931
}
2032

2133
rewatch watch &>/dev/null &

rewatch/tests/suffix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ "$file_count" -eq 20 ];
3131
then
3232
success "Found files with correct suffix"
3333
else
34-
error "Suffix not correctly used"
34+
error "Suffix not correctly used (file count of $file_count)"
3535
exit 1
3636
fi
3737

rewatch/tests/suite-ci.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ export REWATCH_EXECUTABLE
1313
source ./utils.sh
1414

1515
bold "Rescript version"
16-
(cd ../testrepo && yarn rescript -v)
16+
(cd ../testrepo && ./node_modules/.bin/rescript -v)
1717

1818
# we need to reset the yarn.lock and package.json to the original state
1919
# so there is not diff in git. The CI will install new ReScript package
2020
bold "Reset package.json and yarn.lock"
21-
git checkout ../testrepo/yarn.lock
22-
git checkout ../testrepo/package.json
21+
git checkout ../testrepo/yarn.lock &> /dev/null
22+
git checkout ../testrepo/package.json &> /dev/null
2323
success "Reset package.json and yarn.lock"
2424

2525
bold "Make sure the testrepo is clean"

0 commit comments

Comments
 (0)