Print failing poll results on all similar tests

pull/238364/head
Daniel Imms 2025-01-21 05:43:51 -08:00
parent 8cfb26560f
commit 28f5c4f079
No known key found for this signature in database
GPG Key ID: E5CF412B63651C69
1 changed files with 32 additions and 28 deletions

View File

@ -765,7 +765,7 @@ import { assertNoRpc, poll } from '../utils';
// Run sh commands, if this is ever enabled on Windows we would also want to run
// the pwsh equivalent
terminal.sendText('echo "$A $B $C');
terminal.sendText('echo "$A $B $C"');
// Poll for the echo results to show up
try {
@ -808,19 +808,19 @@ import { assertNoRpc, poll } from '../utils';
data += sanitizeData(e.data);
}));
// Run both PowerShell and sh commands, errors don't matter we're just looking for
// the correct output
terminal.sendText('$env:A');
terminal.sendText('echo $A');
terminal.sendText('$env:B');
terminal.sendText('echo $B');
terminal.sendText('$env:C');
terminal.sendText('echo $C');
// Run sh commands, if this is ever enabled on Windows we would also want to run
// the pwsh equivalent
terminal.sendText('echo "$A $B $C"');
// Poll for the echo results to show up
await poll<void>(() => Promise.resolve(), () => data.includes('~a2~'), '~a2~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~b2~'), '~b2~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~c2~'), '~c2~ should be printed');
try {
await poll<void>(() => Promise.resolve(), () => data.includes('~a2~'), '~a2~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~b2~'), '~b2~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~c2~'), '~c2~ should be printed');
} catch (err) {
console.error('DATA UP UNTIL NOW:', data);
throw err;
}
// Wait for terminal to be disposed
await new Promise<void>(r => {
@ -852,16 +852,18 @@ import { assertNoRpc, poll } from '../utils';
data += sanitizeData(e.data);
}));
// Run both PowerShell and sh commands, errors don't matter we're just looking for
// the correct output
terminal.sendText('$env:A');
terminal.sendText('echo $A');
terminal.sendText('$env:B');
terminal.sendText('echo $B');
// Run sh commands, if this is ever enabled on Windows we would also want to run
// the pwsh equivalent
terminal.sendText('echo "$A $B"');
// Poll for the echo results to show up
await poll<void>(() => Promise.resolve(), () => data.includes('~a1~'), '~a1~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~b1~'), '~b1~ should be printed');
try {
await poll<void>(() => Promise.resolve(), () => data.includes('~a1~'), '~a1~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~b1~'), '~b1~ should be printed');
} catch (err) {
console.error('DATA UP UNTIL NOW:', data);
throw err;
}
// Wait for terminal to be disposed
await new Promise<void>(r => {
@ -893,16 +895,18 @@ import { assertNoRpc, poll } from '../utils';
data += sanitizeData(e.data);
}));
// Run both PowerShell and sh commands, errors don't matter we're just looking for
// the correct output
terminal.sendText('$env:A');
terminal.sendText('echo $A');
terminal.sendText('$env:B');
terminal.sendText('echo $B');
// Run sh commands, if this is ever enabled on Windows we would also want to run
// the pwsh equivalent
terminal.sendText('echo "$A $B"');
// Poll for the echo results to show up
await poll<void>(() => Promise.resolve(), () => data.includes('~a1~'), '~a1~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~b2~'), '~b2~ should be printed');
try {
await poll<void>(() => Promise.resolve(), () => data.includes('~a1~'), '~a1~ should be printed');
await poll<void>(() => Promise.resolve(), () => data.includes('~b2~'), '~b2~ should be printed');
} catch (err) {
console.error('DATA UP UNTIL NOW:', data);
throw err;
}
// Wait for terminal to be disposed
await new Promise<void>(r => {