Skip to content
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

test: make debugp collect IO #1485

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Conversation

pavelfeldman
Copy link
Member

No description provided.

state.browser._setDebugFunction(onLine);
}

let rl;
if (state.browserServer.process().stderr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this already happens here. I guess you want stdout as well, you can add it there.

@@ -113,8 +113,11 @@ module.exports.describe = ({testRunner, product, playwrightPath}) => {

beforeEach(async(state, test) => {
const onLine = (line) => test.output += line + '\n';
if (dumpProtocolOnFailure)
if (dumpProtocolOnFailure) {
state.browserServer.process().stdout.on('data', onLine);
Copy link
Contributor

Choose a reason for hiding this comment

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

stdout might be null on the process is somebody set dumpio=true.

@@ -422,7 +422,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FF
await context.close();
});
// flaky: https://github.com/microsoft/playwright/pull/1301/checks?check_run_id=496478707
it.fail(FFOX && LINUX)('should fail if wrong credentials', async({browser, server}) => {
fit('should fail if wrong credentials', async({browser, server}) => {
Copy link
Contributor

@JoelEinbinder JoelEinbinder Mar 23, 2020

Choose a reason for hiding this comment

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

Suggested change
fit('should fail if wrong credentials', async({browser, server}) => {
it.fail(FFOX && LINUX)('should fail if wrong credentials', async({browser, server}) => {

@pavelfeldman pavelfeldman force-pushed the debugp branch 2 times, most recently from a3f9025 to b91f5eb Compare March 23, 2020 19:48
test/playwright.spec.js Show resolved Hide resolved
test/browsercontext.spec.js Outdated Show resolved Hide resolved
src/webkit/wkConnection.ts Outdated Show resolved Hide resolved
@@ -207,7 +207,8 @@ class Reporter {
console.log(`${prefix} ${colors.red(`[TIMEOUT ${test.timeout}ms]`)} ${test.fullName} (${formatLocation(test.location)})`);
if (test.output) {
console.log(' Output:');
console.log(padLines(test.output, 4));
for (const line of test.output)
Copy link
Contributor

Choose a reason for hiding this comment

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

This will indent poorly if a line of output is multiline.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like to be consistent with requre('debug')

Copy link
Contributor

Choose a reason for hiding this comment

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

previously I could do test.output += JSON.stringify(obj, undefined, 2). Now I can't without breaking the indent.

Copy link
Member Author

Choose a reason for hiding this comment

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

We were never putting anything from stdio there at the first place, let's see how it looks first

@@ -207,7 +207,8 @@ class Reporter {
console.log(`${prefix} ${colors.red(`[TIMEOUT ${test.timeout}ms]`)} ${test.fullName} (${formatLocation(test.location)})`);
if (test.output) {
console.log(' Output:');
console.log(padLines(test.output, 4));
for (const line of test.output)
console.log(' ' + line);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
console.log(' ' + line);
console.log(padLines(line, 4));

Copy link
Member Author

Choose a reason for hiding this comment

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

These are different things

Copy link
Contributor

@JoelEinbinder JoelEinbinder left a comment

Choose a reason for hiding this comment

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

If it works, sure.

@pavelfeldman pavelfeldman force-pushed the debugp branch 3 times, most recently from 5965e27 to d762557 Compare March 23, 2020 20:26
@pavelfeldman pavelfeldman merged commit b1bebda into microsoft:master Mar 23, 2020
pavelfeldman added a commit that referenced this pull request Mar 23, 2020
pavelfeldman added a commit to pavelfeldman/playwright that referenced this pull request Mar 23, 2020
@pavelfeldman pavelfeldman deleted the debugp branch April 17, 2020 21:10
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