8000 Debug/fix watch pipeline by lukastaegert · Pull Request #5982 · rollup/rollup · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Debug/fix watch pipeline #5982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension < 8000 label class="SelectMenu-item" role="menuitem"> .js  (2)

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions test/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ runTestSuiteWithSamples(
'cli',
path.resolve(__dirname, 'samples'),
/**
* @param {string} directory
* @param {import('../types').TestConfigCli} config
*/
(directory, config) => {
(config.skip ? it.skip : config.solo ? it.only : it)(
path.basename(directory) + ': ' + config.description,
async () => {
for (let iteration = 0; iteration < (config.repeat || 1); iteration++) {
const description = `${path.basename(directory)}: ${config.description}${iteration > 0 ? ` (run ${iteration + 1})` : ''}`;
(config.skip ? it.skip : config.solo ? it.only : it)(description, async () => {
process.chdir(config.cwd || directory);
try {
await runTest(config);
Expand All @@ -39,8 +40,8 @@ runTestSuiteWithSamples(
}
throw error;
}
}
).timeout(80_000);
}).timeout(80_000);
}
},
() => process.chdir(cwd)
);
Expand Down Expand Up @@ -106,7 +107,9 @@ async function runTest(config) {
}
}
if (childProcess.signalCode === 'SIGKILL') {
return reject(new Error('Test aborted due to timeout.'));
return reject(
new Error(`Test aborted due to timeout.\nstdout: ${stdout}\n\nstderr: ${stderr}\n`)
);
}

if ('stderr' in config) {
Expand Down
6 changes: 4 additions & 2 deletions test/cli/samples/watch/watch-event-hooks-error/_config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const { assertIncludes } = require('../../../../testHelpers.js');
const { assertIncludes, wait } = require('../../../../testHelpers.js');

module.exports = defineTest({
description: 'onError event hook shell commands write to stderr',
spawnScript: 'wrapper.js',
spawnArgs: ['-cw', '--watch.onError', 'echo error'],
abortOnStderr(data) {
async abortOnStderr(data) {
if (data.includes('waiting for changes')) {
// Wait a little for the child process to complete the command
await wait(300);
return true;
}
},
Expand Down
3 changes: 2 additions & 1 deletion test/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ export interface TestConfigCli extends TestConfigBase {
* Run assertions against the exports of the bundle after executing it.
*/
exports?: (exportObject: any) => void | Promise<void>;
repeat?: number;
/**
* Run assertions against the generated code when bundling to stdout.
*/
result?: (code: string) => void;
retry?: number;
retry?: boolean;
/**
* Display generated output in console.
*/
Expand Down
Loading
0