test: add --no-sdk to copilot-install E2E runners + static guard (#2461) (#2463)

Four execFileSync installer calls in copilot-install.test.cjs deleted
GSD_TEST_MODE but omitted --no-sdk, triggering the fatal installSdkIfNeeded()
path in test.yml CI where npm global bin is not on PATH.

Partial fix in e213ce0 patched three hook-deployment tests but missed
runCopilotInstall, runCopilotUninstall, runClaudeInstall, runClaudeUninstall.

Also adds tests/sdk-no-sdk-guard.test.cjs: a static analysis guard that
scans test files for subprocess installer calls missing --no-sdk, so this
class of regression is caught automatically in future.

Closes #2461

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-04-20 10:08:49 -04:00
committed by GitHub
parent 0ea443cbcf
commit d117c1045a
2 changed files with 92 additions and 4 deletions

View File

@@ -1116,7 +1116,7 @@ const EXPECTED_AGENTS = fs.readdirSync(path.join(__dirname, '..', 'agents'))
function runCopilotInstall(cwd) {
const env = { ...process.env };
delete env.GSD_TEST_MODE;
return execFileSync(process.execPath, [INSTALL_PATH, '--copilot', '--local'], {
return execFileSync(process.execPath, [INSTALL_PATH, '--copilot', '--local', '--no-sdk'], {
cwd,
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'pipe'],
@@ -1127,7 +1127,7 @@ function runCopilotInstall(cwd) {
function runCopilotUninstall(cwd) {
const env = { ...process.env };
delete env.GSD_TEST_MODE;
return execFileSync(process.execPath, [INSTALL_PATH, '--copilot', '--local', '--uninstall'], {
return execFileSync(process.execPath, [INSTALL_PATH, '--copilot', '--local', '--uninstall', '--no-sdk'], {
cwd,
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'pipe'],
@@ -1376,7 +1376,7 @@ describe('E2E: Copilot uninstall verification', () => {
function runClaudeInstall(cwd) {
const env = { ...process.env };
delete env.GSD_TEST_MODE;
return execFileSync(process.execPath, [INSTALL_PATH, '--claude', '--local'], {
return execFileSync(process.execPath, [INSTALL_PATH, '--claude', '--local', '--no-sdk'], {
cwd,
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'pipe'],
@@ -1387,7 +1387,7 @@ function runClaudeInstall(cwd) {
function runClaudeUninstall(cwd) {
const env = { ...process.env };
delete env.GSD_TEST_MODE;
return execFileSync(process.execPath, [INSTALL_PATH, '--claude', '--local', '--uninstall'], {
return execFileSync(process.execPath, [INSTALL_PATH, '--claude', '--local', '--uninstall', '--no-sdk'], {
cwd,
encoding: 'utf-8',
stdio: ['pipe', 'pipe', 'pipe'],