Skip to content

Commit 49c215b

Browse files
committed
fix: update test-install workflow for v2 installer paths
- Add PATH export after install (FVM now installs to ~/fvm/bin) - Update test-container to use correct path - Update test-permissions to expect warning instead of blocking for root - Fix uninstall check to use ~/fvm/bin instead of ~/.fvm_flutter
1 parent ba3472f commit 49c215b

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

.github/workflows/test-install.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,21 @@ jobs:
4141
- name: Test installation
4242
run: |
4343
./scripts/install.sh
44+
export PATH="$HOME/fvm/bin:$PATH"
4445
fvm --version
45-
46+
4647
- name: Test reinstall (idempotency)
4748
run: |
4849
./scripts/install.sh
50+
export PATH="$HOME/fvm/bin:$PATH"
4951
fvm --version
50-
52+
5153
- name: Test uninstall
5254
run: |
55+
export PATH="$HOME/fvm/bin:$PATH"
5356
# First ensure FVM is installed
5457
which fvm
55-
ls -la ~/.fvm_flutter/bin/
58+
ls -la ~/fvm/bin/
5659
5760
# Run uninstall
5861
./scripts/install.sh --uninstall
@@ -63,8 +66,8 @@ jobs:
6366
exit 1
6467
fi
6568
66-
if [[ -d ~/.fvm_flutter ]]; then
67-
echo "❌ FVM directory still exists after uninstall"
69+
if [[ -d ~/fvm/bin ]]; then
70+
echo "❌ FVM bin directory still exists after uninstall"
6871
exit 1
6972
fi
7073
@@ -91,35 +94,30 @@ jobs:
9194
- name: Test container root allowed
9295
run: |
9396
./scripts/install.sh
94-
/usr/local/bin/fvm --version
97+
export PATH="$HOME/fvm/bin:$PATH"
98+
fvm --version
9599
96-
# Test root blocking on non-container
100+
# Test root warning on non-container
97101
test-permissions:
98102
name: Test Permissions
99103
needs: validate
100104
runs-on: ubuntu-latest
101105
steps:
102106
- uses: actions/checkout@v4
103-
104-
- name: Test root blocked
105-
run: |
106-
# Should fail when run as root without container. Capture output instead of
107-
# piping so pipefail doesn't mask the expected non-zero exit code.
108-
set +e
109-
sudo ./scripts/install.sh > /tmp/fvm_install_root.log 2>&1
110-
status=$?
111-
set -e
112107

113-
cat /tmp/fvm_install_root.log
108+
- name: Test root shows warning but succeeds
109+
run: |
110+
output=$(sudo -H ./scripts/install.sh 2>&1)
111+
echo "$output"
114112
115-
if [[ $status -ne 0 ]] && grep -q "should not be run as root" /tmp/fvm_install_root.log; then
116-
echo "✅ Root correctly blocked"
113+
# Should show warning
114+
if echo "$output" | grep -q "Warning: Running as root"; then
115+
echo "✅ Root warning displayed"
117116
else
118-
echo "❌ Root should have been blocked"
117+
echo "❌ Expected root warning"
119118
exit 1
120119
fi
121-
122-
- name: Test with override
123-
run: |
124-
sudo env FVM_ALLOW_ROOT=true ./scripts/install.sh
125-
sudo /usr/local/bin/fvm --version
120+
121+
# Should succeed
122+
sudo -H /root/fvm/bin/fvm --version
123+
echo "✅ Root install successful"

0 commit comments

Comments
 (0)