Skip to content

Commit e1e02df

Browse files
committed
Remove smoke test on downloaded binary. Triggered EPERM error on Windows. Also adds latency, and it doesn't really add value anyway
1 parent 024f144 commit e1e02df

File tree

2 files changed

+2
-114
lines changed

2 files changed

+2
-114
lines changed

cli/release-staging/index.js

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -193,51 +193,6 @@ function getCurrentVersion() {
193193
}
194194
}
195195

196-
function runSmokeTest(binaryPath) {
197-
return new Promise((resolve) => {
198-
if (!fs.existsSync(binaryPath)) {
199-
resolve(false)
200-
return
201-
}
202-
203-
const child = spawn(binaryPath, ['--version'], {
204-
cwd: os.homedir(),
205-
stdio: 'pipe',
206-
})
207-
208-
let output = ''
209-
210-
child.stdout.on('data', (data) => {
211-
output += data.toString()
212-
})
213-
214-
const timeout = setTimeout(() => {
215-
child.kill('SIGTERM')
216-
setTimeout(() => {
217-
if (!child.killed) {
218-
child.kill('SIGKILL')
219-
}
220-
}, 1000)
221-
resolve(false)
222-
}, 5000)
223-
224-
child.on('exit', (code) => {
225-
clearTimeout(timeout)
226-
// Check that it exits successfully and outputs something that looks like a version
227-
if (code === 0 && output.trim().match(/^\d+(\.\d+)*(-beta\.\d+)?$/)) {
228-
resolve(true)
229-
} else {
230-
resolve(false)
231-
}
232-
})
233-
234-
child.on('error', () => {
235-
clearTimeout(timeout)
236-
resolve(false)
237-
})
238-
})
239-
}
240-
241196
function compareVersions(v1, v2) {
242197
if (!v1 || !v2) return 0
243198

@@ -399,18 +354,7 @@ async function downloadBinary(version) {
399354
fs.chmodSync(tempBinaryPath, 0o755)
400355
}
401356

402-
// Run smoke test on the downloaded binary
403-
term.write('Verifying download...')
404-
const smokeTestPassed = await runSmokeTest(tempBinaryPath)
405-
406-
if (!smokeTestPassed) {
407-
fs.rmSync(CONFIG.tempDownloadDir, { recursive: true })
408-
const error = new Error('Downloaded binary failed smoke test (--version check)')
409-
trackUpdateFailed(error.message, version, { stage: 'smoke_test' })
410-
throw error
411-
}
412-
413-
// Smoke test passed - move binary to final location
357+
// Move binary to final location
414358
try {
415359
if (fs.existsSync(CONFIG.binaryPath)) {
416360
try {

cli/release/index.js

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -192,51 +192,6 @@ function getCurrentVersion() {
192192
}
193193
}
194194

195-
function runSmokeTest(binaryPath) {
196-
return new Promise((resolve) => {
197-
if (!fs.existsSync(binaryPath)) {
198-
resolve(false)
199-
return
200-
}
201-
202-
const child = spawn(binaryPath, ['--version'], {
203-
cwd: os.homedir(),
204-
stdio: 'pipe',
205-
})
206-
207-
let output = ''
208-
209-
child.stdout.on('data', (data) => {
210-
output += data.toString()
211-
})
212-
213-
const timeout = setTimeout(() => {
214-
child.kill('SIGTERM')
215-
setTimeout(() => {
216-
if (!child.killed) {
217-
child.kill('SIGKILL')
218-
}
219-
}, 1000)
220-
resolve(false)
221-
}, 5000)
222-
223-
child.on('exit', (code) => {
224-
clearTimeout(timeout)
225-
// Check that it exits successfully and outputs something that looks like a version
226-
if (code === 0 && output.trim().match(/^\d+(\.\d+)*$/)) {
227-
resolve(true)
228-
} else {
229-
resolve(false)
230-
}
231-
})
232-
233-
child.on('error', () => {
234-
clearTimeout(timeout)
235-
resolve(false)
236-
})
237-
})
238-
}
239-
240195
function compareVersions(v1, v2) {
241196
if (!v1 || !v2) return 0
242197

@@ -398,18 +353,7 @@ async function downloadBinary(version) {
398353
fs.chmodSync(tempBinaryPath, 0o755)
399354
}
400355

401-
// Run smoke test on the downloaded binary
402-
term.write('Verifying download...')
403-
const smokeTestPassed = await runSmokeTest(tempBinaryPath)
404-
405-
if (!smokeTestPassed) {
406-
fs.rmSync(CONFIG.tempDownloadDir, { recursive: true })
407-
const error = new Error('Downloaded binary failed smoke test (--version check)')
408-
trackUpdateFailed(error.message, version, { stage: 'smoke_test' })
409-
throw error
410-
}
411-
412-
// Smoke test passed - move binary to final location
356+
// Move binary to final location
413357
try {
414358
if (fs.existsSync(CONFIG.binaryPath)) {
415359
try {

0 commit comments

Comments
 (0)