FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test_runner: handled change for exposing 'spec' reporter by Sumi0 · Pull Request #48202 · nodejs/node · GitHub

/ node Public

test_runner: handled change for exposing 'spec' reporter - #48202

Closed
Sumi0 wants to merge 3 commits into
nodejs:mainfrom
Sumi0:main
Closed

test_runner: handled change for exposing 'spec' reporter#48202
Sumi0 wants to merge 3 commits into
nodejs:mainfrom
Sumi0:main

Conversation

Sumi0 commented May 27, 2023
edited
Loading

Copy link
Copy Markdown

Fixes: Issue#48112

Other reporters (dot, tap) by signature are a function while 'spec'
reporter is a ES6 class.

This behaviour of api spec is causing difference in semantics while
consumption since it has not been addressed anywhere in the document
(it has to be instantiated).

Instead of making changes in the signature of spec.js, i have proposed
changes where the 'spec' reporter gets exposed in reporter.js

Refs: reporter/spec.js
Refs: (@line-no:143) test_runner/utils.js

Other reporters (dot, tap) by signature are a function while 'spec' reporter is a ES6 class.

This behaviour of api spec is causing difference in semantics while consumption since it has not been addressed anywhere in the document (it has to be instantiated).

Instead of making changes in the signature of spec.js, i have proposed changes where the 'spec' reporter gets exposed in reporter.js

Fixes: nodejs#48112
Refs: https://github.com/nodejs/node/blob/main/lib/internal/test_runner/reporter/spec.js
Refs: (@line-no:143) https://github.com/nodejs/node/blob/main/lib/internal/test_runner/utils.js

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels May 27, 2023
Comment thread lib/test/reporters.js Outdated
Comment thread lib/test/reporters.js Outdated
MoLow requested a review from aduh95 June 1, 2023 06:47

Sumi0 commented Jun 1, 2023

Copy link
Copy Markdown
Author

I do not understand why is the test failing @line-no:79 test-runner-run.mjs.
Where could be the root-cause ? @MoLow @aduh95

MoLow commented Jun 1, 2023

Copy link
Copy Markdown
Member

you should debug locally with ./node test/parallel/test-runner-run.mjs

Sumi0 commented Jun 1, 2023

Copy link
Copy Markdown
Author

I do not understand why is the test failing @line-no:79 test-runner-run.mjs.
Where could be the root-cause ? @MoLow @aduh95

    not ok 9 - should be piped with spec
      ---
      duration_ms: 1767.493155
      failureType: 'cancelledByParent'
      error: 'Promise resolution is still pending but the event loop has already resolved'
      code: 'ERR_TEST_FAILURE'
      stack: |-
        process.emit (node:events:523:35)
      ...

Comment thread lib/test/reporters.js
Comment on lines +24 to +25
value: spec ?? function SpecReporter() {
return ReflectConstruct(require('internal/test_runner/reporter/spec'), arguments);

aduh95 Jun 1, 2023
edited
Loading

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
value: spec ?? function SpecReporter() {
return ReflectConstruct(require('internal/test_runner/reporter/spec'), arguments);
value: function SpecReporter() {
spec ??= require('internal/test_runner/reporter/spec');
return ReflectConstruct(spec, arguments, new.target);

(not sure about the new.target)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let me run full test this time on my local and check.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@atlowChemi I have tried all versions of returning instance of a class (imported with require), either with new keyword or with Reflect.construct, and both are not working.
I am not able to identify the Root cause.

cjihrig commented Aug 15, 2023

Copy link
Copy Markdown
Contributor

@Sumi0 are you still planning to work on this, or should it be closed?

aduh95 added the stalled Issues and PRs that are stalled. label May 11, 2024

Copy link
Copy Markdown
Contributor

This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open.

Copy link
Copy Markdown
Member

This was already superseded by #49184

benjamingr closed this May 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. stalled Issues and PRs that are stalled. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify that spec reporter is a class and needs to be instantiate for usage with run

6 participants


Back | FazBrowse Home | New Git URL