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

Added real time reporting to spec reporter #7572

Merged
merged 40 commits into from Dec 17, 2021

Conversation

praveendvd
Copy link
Contributor

@praveendvd praveendvd commented Oct 20, 2021

Proposed changes

This pull request logs the current test status (Pass , failed ,skipped) for spec reporter .

This will fix :

Allow real time reporting of reporters using WDIO Testrunner #7532

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

Test will be added

Reviewers: @webdriverio/project-committers

@christian-bromann
Copy link
Member

christian-bromann commented Oct 20, 2021

@praveendvd thanks for taking a stab at this.

Do you have a gif animation how this looks like? Also I believe we should make this optional as it adds additional clutter to stdout.

@praveendvd
Copy link
Contributor Author

@praveendvd thanks for taking a stab at this.

Do you have a gif animation how this looks like?

I already added that in previous comment , could you have a look

@praveendvd
Copy link
Contributor Author

@praveendvd
Copy link
Contributor Author

This is with logging set to silent in config file

@BorisOsipov
Copy link
Member

@praveendvd @christian-bromann are you sure that for maxInstances> 1...100 the terminal logs won't become a terrible mess?

It is riduculus that we call console.log() when we have @wdio/logger...

@praveendvd
Copy link
Contributor Author

@praveendvd @christian-bromann are you sure that for maxInstances> 1...100 the terminal logs won't become a terrible mess?

It is riduculus that we call console.log() when we have @wdio/logger...

Could you let me know how to use the logger ? i used this.write but it flushes the output only after the execution completes. Doesnt behave in a realtime manner

@praveendvd
Copy link
Contributor Author

@christian-bromann The test fails for the sync setup and is not related to this pull request i guesss. Could you have a look Thank you 👏👍

@BorisOsipov
Copy link
Member

Could you let me know how to use the logger ?

I don't know. Need investigation why it doesn't print "realtime". I think if logger is not worked as you desired it is not the reason to use console.log().

@christian-bromann
Copy link
Member

@praveendvd I am working on fixing the main branch right now, I will let you know when I am done so you can rebase.

@praveendvd
Copy link
Contributor Author

praveendvd commented Oct 21, 2021

test

@christian-bromann and @BorisOsipov

image

@praveendvd
Copy link
Contributor Author

@BorisOsipov @christian-bromann replaced console.log with logger and explicit log.level info

@praveendvd
Copy link
Contributor Author

@christian-bromann Changed logger to event , now we send a realtimereport event that will log to console . We can throw this event from any reporter

@praveendvd
Copy link
Contributor Author

praveendvd commented Dec 4, 2021

I added the change but i strogly believe logger will be much more useful as @BorisOsipov mentioned. This implementation works well if the loglevel is silent else the status will get hidden in the sea of logs that we get from wdio. IF we use logger , then user can opt of point it to a file if required so that they can see it in a much more cleaner way .

so the new implementation works exactly the same as if we use logger, but doesnt have option to write to a file. should we implement a flag that allows to write to a file ? but for real time i am not sure if a file write is required or not

packages/wdio-spec-reporter/src/index.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/src/index.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/src/index.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/src/index.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/README.md Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/src/index.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/src/types.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/src/types.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/tests/index.test.ts Outdated Show resolved Hide resolved
packages/wdio-spec-reporter/tests/index.test.ts Outdated Show resolved Hide resolved
@christian-bromann
Copy link
Member

Just added some minor formatting adjustments and renamed the new option from realTimeReporting to realtimeReporting given that realtime is one word.

@christian-bromann
Copy link
Member

There seems to be a typing issue with Jest. I will go ahead and merge and check in main branch.

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.

Thanks a lot, this is awesome 👍

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

3 participants