Skip to content

Commit 6ba39e4

Browse files
committed
blerg
1 parent 2adc557 commit 6ba39e4

File tree

1 file changed

+119
-70
lines changed

1 file changed

+119
-70
lines changed

test/unit/quiet-test.js

Lines changed: 119 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -195,93 +195,142 @@ test('deploy.sam with quiet=true suppresses updater output', async () => {
195195
})
196196

197197
test('deploy.sam with default (no quiet param) shows output', async () => {
198-
let inv = await inventory({
199-
rawArc: '@app\ntest-app\n@static',
200-
deployStage: 'staging',
201-
})
198+
try {
199+
console.error('[DEBUG] Starting deploy.sam default test')
200+
let inv = await inventory({
201+
rawArc: '@app\ntest-app\n@static',
202+
deployStage: 'staging',
203+
})
204+
console.error('[DEBUG] Inventory created')
202205

203-
captureOutput()
206+
captureOutput()
207+
console.error('[DEBUG] Output capture started')
204208

205-
await deploy.sam({
206-
inventory: inv,
207-
isDryRun: true,
208-
region: 'us-west-2',
209-
shouldHydrate: false,
210-
// No quiet parameter - should default to showing output
211-
})
209+
await deploy.sam({
210+
inventory: inv,
211+
isDryRun: true,
212+
region: 'us-west-2',
213+
shouldHydrate: false,
214+
// No quiet parameter - should default to showing output
215+
})
216+
console.error('[DEBUG] deploy.sam completed')
212217

213-
restoreOutput()
218+
restoreOutput()
219+
console.error('[DEBUG] Output restored')
214220

215-
let outputCount = getOutputCount()
216-
let outputContent = getOutputContent()
221+
let outputCount = getOutputCount()
222+
let outputContent = getOutputContent()
223+
console.error(`[DEBUG] Output count: ${outputCount}`)
217224

218-
assert.ok(outputCount > 0, `Default mode shows output (${outputCount} messages)`)
219-
assert.ok(outputContent.includes('Deploy'), `Output contains deploy messages`)
225+
assert.ok(outputCount > 0, `Default mode shows output (${outputCount} messages)`)
226+
assert.ok(outputContent.includes('Deploy'), `Output contains deploy messages`)
227+
console.error('[DEBUG] Test passed')
228+
} catch (err) {
229+
console.error('[DEBUG] Test failed with error:', err.message)
230+
console.error('[DEBUG] Stack:', err.stack)
231+
throw err
232+
}
220233
})
221234

222235
test('deploy.direct with quiet=true suppresses updater output', async () => {
223-
let inv = await inventory({
224-
rawArc: '@app\ntest-app\n@http\nget /',
225-
deployStage: 'staging',
226-
})
227-
228-
captureOutput()
229-
await deploy.direct({
230-
inventory: inv,
231-
isDryRun: true,
232-
region: 'us-west-2',
233-
shouldHydrate: false,
234-
quiet: false,
235-
srcDirs: [ 'src/http/get-index' ],
236-
})
237-
238-
restoreOutput()
239-
let normalCount = getOutputCount()
240-
241-
captureOutput()
242-
await deploy.direct({
243-
inventory: inv,
244-
isDryRun: true,
245-
region: 'us-west-2',
246-
shouldHydrate: false,
247-
quiet: true,
248-
srcDirs: [ 'src/http/get-index' ],
249-
})
250-
restoreOutput()
251-
let quietCount = getOutputCount()
252-
253-
assert.ok(normalCount > 5, `Normal mode has substantial output (${normalCount} messages)`)
254-
assert.strictEqual(quietCount, 0, `Quiet mode completely suppresses output (${quietCount} messages, was ${normalCount})`)
236+
try {
237+
console.error('[DEBUG] Starting deploy.direct quiet comparison test')
238+
let inv = await inventory({
239+
rawArc: '@app\ntest-app\n@http\nget /',
240+
deployStage: 'staging',
241+
})
242+
console.error('[DEBUG] Inventory created')
243+
244+
console.error('[DEBUG] Testing quiet=false')
245+
captureOutput()
246+
await deploy.direct({
247+
inventory: inv,
248+
isDryRun: true,
249+
region: 'us-west-2',
250+
shouldHydrate: false,
251+
quiet: false,
252+
srcDirs: [ 'src/http/get-index' ],
253+
})
254+
255+
restoreOutput()
256+
let normalCount = getOutputCount()
257+
console.error(`[DEBUG] Normal mode output count: ${normalCount}`)
258+
259+
console.error('[DEBUG] Testing quiet=true')
260+
captureOutput()
261+
await deploy.direct({
262+
inventory: inv,
263+
isDryRun: true,
264+
region: 'us-west-2',
265+
shouldHydrate: false,
266+
quiet: true,
267+
srcDirs: [ 'src/http/get-index' ],
268+
})
269+
restoreOutput()
270+
let quietCount = getOutputCount()
271+
console.error(`[DEBUG] Quiet mode output count: ${quietCount}`)
272+
273+
assert.ok(normalCount > 5, `Normal mode has substantial output (${normalCount} messages)`)
274+
assert.strictEqual(quietCount, 0, `Quiet mode completely suppresses output (${quietCount} messages, was ${normalCount})`)
275+
console.error('[DEBUG] Test passed')
276+
} catch (err) {
277+
console.error('[DEBUG] Test failed with error:', err.message)
278+
console.error('[DEBUG] Stack:', err.stack)
279+
throw err
280+
}
255281
})
256282

257283
test('deploy.direct with quiet=false shows output', async () => {
258-
let inv = await inventory({
259-
rawArc: '@app\ntest-app\n@http\nget /',
260-
deployStage: 'staging',
261-
})
284+
try {
285+
console.error('[DEBUG] Starting deploy.direct quiet=false test')
286+
let inv = await inventory({
287+
rawArc: '@app\ntest-app\n@http\nget /',
288+
deployStage: 'staging',
289+
})
290+
console.error('[DEBUG] Inventory created')
262291

263-
captureOutput()
292+
captureOutput()
293+
console.error('[DEBUG] Output capture started')
264294

265-
await deploy.direct({
266-
inventory: inv,
267-
isDryRun: true,
268-
region: 'us-west-2',
269-
shouldHydrate: false,
270-
quiet: false, // Explicitly not quiet
271-
srcDirs: [ 'src/http/get-index' ],
272-
})
295+
await deploy.direct({
296+
inventory: inv,
297+
isDryRun: true,
298+
region: 'us-west-2',
299+
shouldHydrate: false,
300+
quiet: false, // Explicitly not quiet
301+
srcDirs: [ 'src/http/get-index' ],
302+
})
303+
console.error('[DEBUG] deploy.direct completed')
273304

274-
restoreOutput()
305+
restoreOutput()
306+
console.error('[DEBUG] Output restored')
275307

276-
let outputCount = getOutputCount()
277-
let outputContent = getOutputContent()
308+
let outputCount = getOutputCount()
309+
let outputContent = getOutputContent()
310+
console.error(`[DEBUG] Output count: ${outputCount}`)
278311

279-
assert.ok(outputCount > 0, `Non-quiet mode shows output (${outputCount} messages)`)
280-
assert.ok(outputContent.includes('Deploy'), `Output contains deploy messages: ${outputContent.substring(0, 100)}...`)
312+
assert.ok(outputCount > 0, `Non-quiet mode shows output (${outputCount} messages)`)
313+
assert.ok(outputContent.includes('Deploy'), `Output contains deploy messages: ${outputContent.substring(0, 100)}...`)
314+
console.error('[DEBUG] Test passed')
315+
} catch (err) {
316+
console.error('[DEBUG] Test failed with error:', err.message)
317+
console.error('[DEBUG] Stack:', err.stack)
318+
throw err
319+
}
281320
})
282321

283322
test('Teardown', () => {
284-
awsLite.testing.disable()
285-
awsLite.testing.reset()
286-
assert.ok(!awsLite.testing.isEnabled(), 'AWS client testing disabled')
323+
try {
324+
console.error('[DEBUG] Starting Teardown test')
325+
awsLite.testing.disable()
326+
console.error('[DEBUG] AWS testing disabled')
327+
awsLite.testing.reset()
328+
console.error('[DEBUG] AWS testing reset')
329+
assert.ok(!awsLite.testing.isEnabled(), 'AWS client testing disabled')
330+
console.error('[DEBUG] Teardown test passed')
331+
} catch (err) {
332+
console.error('[DEBUG] Teardown test failed:', err.message)
333+
console.error('[DEBUG] Stack:', err.stack)
334+
throw err
335+
}
287336
})

0 commit comments

Comments
 (0)