Skip to content

Commit c913806

Browse files
Kevin/integration test fixes (#69)
* fix: debug why goenv is not uninstalled * fix: go verify uninstallation to be less strict because of github actions limitations
1 parent 7f6e0c7 commit c913806

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
11
#!/bin/bash
2-
set -euo pipefail
2+
set -uo pipefail
3+
4+
fail=0
35

46
if [ -d "$HOME/.nvm" ]; then
57
echo "FAIL: ~/.nvm still exists after destroy" >&2
6-
exit 1
8+
ls -la "$HOME/.nvm" >&2
9+
fail=1
710
fi
811

9-
if [ -d "$HOME/.goenv" ] || command -v goenv >/dev/null 2>&1; then
10-
echo "FAIL: goenv still present after destroy" >&2
11-
exit 1
12+
# Check for goenv itself, not for $GOENV_ROOT as a whole. On the macOS runner the Go module
13+
# cache lives at $GOENV_ROOT/shared/go-mod and is repopulated by Go tooling after the destroy,
14+
# so the bare directory existing says nothing about whether goenv is still installed.
15+
for leftover in "$HOME/.goenv/bin" "$HOME/.goenv/shims" "$HOME/.goenv/versions"; do
16+
if [ -d "$leftover" ]; then
17+
echo "FAIL: $leftover still exists after destroy" >&2
18+
ls -la "$leftover" >&2
19+
fail=1
20+
fi
21+
done
22+
23+
if command -v goenv >/dev/null 2>&1; then
24+
echo "FAIL: 'goenv' is still resolvable after destroy" >&2
25+
echo " command -v goenv -> $(command -v goenv)" >&2
26+
echo " type goenv -> $(type goenv 2>&1 | head -3)" >&2
27+
IFS=: read -ra _dirs <<< "$PATH"
28+
for _d in "${_dirs[@]}"; do
29+
[ -e "$_d/goenv" ] && echo " on PATH: $_d/goenv" >&2
30+
done
31+
if command -v brew >/dev/null 2>&1; then
32+
brew list --formula 2>/dev/null | grep -x goenv >/dev/null \
33+
&& echo " brew still lists the goenv formula" >&2
34+
fi
35+
fail=1
1236
fi
1337

38+
[ "$fail" -ne 0 ] && exit 1
39+
1440
echo "nvm and goenv confirmed removed."

0 commit comments

Comments
 (0)