Skip to content

Commit cc7cab1

Browse files
author
ide-coder
committed
fix: use interactive shell in CI to simulate VS Code terminal behavior
Change 'bash -c' to 'bash -i -c' in CI tests to match VS Code terminal environment (interactive non-login shell that loads .bashrc). This ensures CI tests actually validate the user experience in VS Code terminal.
1 parent b2a73fa commit cc7cab1

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/build-and-push.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,21 @@ jobs:
195195
fi
196196
echo "✓ Default user is 'coder'"
197197
198-
- name: Test installed tools accessibility
198+
- name: Test installed tools accessibility (VS Code terminal simulation)
199199
timeout-minutes: 5
200200
run: |
201201
echo "Testing installed tools accessibility for coder user..."
202+
echo "Using interactive shell (bash -i) to simulate VS Code terminal behavior"
202203
203204
# Test function with timeout
205+
# Uses 'bash -i -c' to simulate VS Code terminal (interactive non-login shell)
206+
# This ensures .bashrc is loaded, matching real VS Code terminal environment
204207
test_tool() {
205208
local tool=$1
206209
local cmd=$2
207210
local timeout_secs=10
208211
209-
if timeout $timeout_secs docker exec test-container bash -c "$cmd" > /dev/null 2>&1; then
212+
if timeout $timeout_secs docker exec test-container bash -i -c "$cmd" > /dev/null 2>&1; then
210213
echo " ✓ $tool is accessible"
211214
return 0
212215
else
@@ -257,7 +260,7 @@ jobs:
257260
exit 1
258261
fi
259262
260-
echo "✓ All tools are accessible for coder user"
263+
echo "✓ All tools are accessible for coder user (VS Code terminal simulation)"
261264
262265
- name: Test sudo without password
263266
timeout-minutes: 1
@@ -279,17 +282,18 @@ jobs:
279282
timeout-minutes: 2
280283
run: |
281284
echo "Testing mirror configurations..."
285+
echo "Using interactive shell (bash -i) to simulate VS Code terminal behavior"
282286
283287
# Test Go proxy
284-
docker exec test-container bash -c 'echo $GOPROXY | grep -q "goproxy.cn"' && echo " ✓ Go proxy configured" || echo " ⚠ Go proxy not using goproxy.cn"
288+
docker exec test-container bash -i -c 'echo $GOPROXY | grep -q "goproxy.cn"' && echo " ✓ Go proxy configured" || echo " ⚠ Go proxy not using goproxy.cn"
285289
286290
# Test npm registry
287-
docker exec test-container bash -c 'npm config get registry | grep -q "npmmirror"' && echo " ✓ npm registry configured" || echo " ⚠ npm registry not using npmmirror"
291+
docker exec test-container bash -i -c 'npm config get registry | grep -q "npmmirror"' && echo " ✓ npm registry configured" || echo " ⚠ npm registry not using npmmirror"
288292
289293
# Test gem sources
290-
docker exec test-container bash -c 'gem sources | grep -q "ruby-china"' && echo " ✓ gem sources configured" || echo " ⚠ gem sources not using ruby-china"
294+
docker exec test-container bash -i -c 'gem sources | grep -q "ruby-china"' && echo " ✓ gem sources configured" || echo " ⚠ gem sources not using ruby-china"
291295
292-
echo "✓ Mirror configurations verified"
296+
echo "✓ Mirror configurations verified (VS Code terminal simulation)"
293297
294298
- name: Cleanup test container
295299
if: always()

0 commit comments

Comments
 (0)