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

Fix for #10853 - Show test logs in terminal grouped by Worker Instance #11871

Conversation

tech-dm-klymenko
Copy link
Contributor

Issue: #10853

Proposed changes

Currently logs are generated and promptly displayed on the terminal during a test run. However, this poses a challenge during parallel test execution, as the test logs from different workers become intermingled, causing inconvenience in identification.

The proposed enhancements fix this issue by organizing test logs in the terminal based on the respective workers, thereby streamlining the process of distinguishing and interpreting the output from different workers.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@erwinheitzman
Copy link
Member

erwinheitzman commented Dec 14, 2023

I feel like this should be a choice (an option) instead as it changes the reporting output that people expect.
@christian-bromann what are your thoughts on this?

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

I agree, the behavior whether:

  • logs are printed in real time unordered or
  • logs are printed in order at the end

should be something configurable or we say if there is only 1 instance running we print it immediately, with more than 1 instance running in parallel we print them ordered at the end. But even then I can see people wanting to see the logs in real time.

Suggestions?

packages/wdio-types/src/Workers.ts Outdated Show resolved Hide resolved
@BorisOsipov
Copy link
Member

I remember on Wdio v4-5 we had logs that were printed in real time. Then someone made a PR to print the logs grouped by worker when the worker finished. Now we seem to be back to wdio v4-5 log printing version. Will we change this every few years?))

I agree with erwinheitzman that there should be an option for these two behaviours.

@BorisOsipov
Copy link
Member

I may be wrong about the versions and behaviour of log printing, but I seem to recall that this is not the first time we have changed it.

@tech-dm-klymenko
Copy link
Contributor Author

I've added new option groupLogsByTestSpec that gives users the choice of how logs are presented: either in real-time or grouped. By default, logs are displayed in real-time to maintain continuity with the current user experience and avoid altering the accustomed display method.

@tech-dm-klymenko
Copy link
Contributor Author

Documentation has been updated

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Some minor edits and suggestions.

packages/wdio-cli/src/launcher.ts Outdated Show resolved Hide resolved
packages/wdio-local-runner/src/worker.ts Outdated Show resolved Hide resolved
website/docs/Configuration.md Outdated Show resolved Hide resolved
packages/wdio-types/src/Options.ts Outdated Show resolved Hide resolved
packages/wdio-types/src/Options.ts Outdated Show resolved Hide resolved
packages/wdio-types/src/Options.ts Outdated Show resolved Hide resolved
@tech-dm-klymenko
Copy link
Contributor Author

@christian-bromann
All recommended changes have been made. Please review it one more time

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

Minor

packages/wdio-local-runner/src/transformStream.ts Outdated Show resolved Hide resolved
packages/wdio-types/src/Options.ts Outdated Show resolved Hide resolved
packages/wdio-cli/src/constants.ts Outdated Show resolved Hide resolved
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@christian-bromann christian-bromann added the PR: New Feature 🚀 PRs that contain new features label Dec 20, 2023
@christian-bromann christian-bromann merged commit c6db464 into webdriverio:main Dec 20, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: New Feature 🚀 PRs that contain new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants