Skip to content

feat: pause at test end or error when debugging - #828

Open
Dmitry Gozman (dgozman) wants to merge 1 commit into
microsoft:mainfrom
dgozman:reland-719
Open

Dmitry Gozman (dgozman) wants to merge 1 commit into
microsoft:mainfrom
dgozman:reland-719

Conversation

@dgozman

Copy link
Copy Markdown
Contributor

Summary

Comment thread src/extension.ts
private async _onTestPaused(params: { errors: reporterTypes.TestError[] }) {
if (!this._testUnderDebug)
return;
const errors = params.errors.filter(e => !!e.message);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errors from throwing a string only have value so this drops the failure and shows a pause at the end instead

FORCE_COLOR: '1',
PW_TEST_SOURCE_TRANSFORM: require.resolve('./debugTransform'),
PW_TEST_SOURCE_TRANSFORM_SCOPE: testDirs.join(pathSeparator),
PW_TEST_SOURCE_TRANSFORM: this._model.config.version < kMinTestPausedVersion ? require.resolve('./debugTransform') : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabling this transform loses the existing debugger stop when a test body passes but afterEach fails in a batch because the runner checks pauseOnError before the hook runs

the cutoff needs to require a runner version that pauses on hook and teardown failures before the remaining cleanup

locations: locationPatterns,
testIds,
timeout: 0,
pauseAtEnd: isSingleTest,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isSingleTest is calculated separately for each confi so selecting one test from each of two configs makes the first passing test pause and blocks the second config

the existing enqueuedSingleTest flag from the overall request could be passed through as an additional guard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants