Skip to content

Commit e39bdea

Browse files
committed
chore: further increase logging in CLI integ test
1 parent 1ca3e00 commit e39bdea

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ export function integTest(
3535
output.write(`${name}\n`);
3636
output.write('================================================================\n');
3737

38+
const now = Date.now();
39+
process.stderr.write(`[INTEG TEST::${name}] Starting (pid ${process.pid})...\n`);
3840
try {
39-
process.stderr.write(`▶️ [INTEG TEST::${name}] Starting...\n`);
4041
return await callback({
4142
output,
4243
randomString: randomString(),
@@ -45,7 +46,7 @@ export function integTest(
4546
},
4647
});
4748
} catch (e) {
48-
process.stderr.write(`💥 [INTEG TEST::${name}] Failed: ${e}\n`);
49+
process.stderr.write(`[INTEG TEST::${name}] Failed: ${e}\n`);
4950
output.write(e.message);
5051
output.write(e.stack);
5152
// Print output only if the test fails. Use 'console.log' so the output is buffered by
@@ -54,7 +55,8 @@ export function integTest(
5455
console.log(output.buffer().toString());
5556
throw e;
5657
} finally {
57-
process.stderr.write(`⏹️ [INTEG TEST::${name}] Done.\n`);
58+
const duration = Date.now() - now;
59+
process.stderr.write(`[INTEG TEST::${name}] Done (${duration} ms).\n`);
5860
}
5961
}, timeoutMillis);
6062
}

packages/@aws-cdk-testing/cli-integ/lib/resource-pool.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,15 @@ export class ResourcePool<A extends string=string> {
8787

8888
private makeLease(value: A): ILease<A> {
8989
let disposed = false;
90+
process.stderr.write(`Lease acquired by ${process.pid}: ${value}`);
9091
return {
9192
value,
92-
dispose: () => {
93+
dispose: async () => {
9394
if (disposed) {
9495
throw new Error('Calling dispose() on an already-disposed lease.');
9596
}
9697
disposed = true;
97-
return this.returnValue(value);
98+
return this.returnValue(value).finally(() => process.stderr.write(`Lease returned by ${process.pid}: ${value}`));
9899
},
99100
};
100101
}

packages/aws-cdk/test/integ/cli/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -eu
33
# This is a backwards compatibility script. All logic has moved to '@aws-cdk-testing/cli-integ'
44
# and should be called from there directly.
55

6-
exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION cli-integ-tests
6+
exec ${INTEG_TOOLS}/bin/run-suite --use-cli-release=$VERSION --verbose cli-integ-tests

0 commit comments

Comments
 (0)