Skip to content

Conversation

@dancastillo
Copy link
Member

Checklist

This PR install borp and adds test/test-reporter.mjs to run all tap and node:test test suites which will allow to incrementally migrate from tap to node:test.
This PR is insired from this comment #5683 (comment)

@dancastillo dancastillo marked this pull request as draft October 1, 2024 13:27
async function * reporter (source) {
const failed = new Set()
const diagnostics = new Set()
diagnostics.add('\n\n')
Copy link
Member

Choose a reason for hiding this comment

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

Let's leave formatting of output to the display section of the code and only display diagnostic messages when any exist (as we do with failed files).

@jsumners jsumners mentioned this pull request Oct 5, 2024
3 tasks
@dancastillo
Copy link
Member Author

Could this be an issue wiith borp on windows? Looks like macos and ubuntu run without issue
https://github.com/fastify/fastify/actions/runs/11236848075/job/31237887369?pr=5720

@jsumners
Copy link
Member

jsumners commented Oct 8, 2024

It's due to --reporter=test/test-reporter.mjs and https://github.com/mcollina/borp/blob/339c6915bc2a782bea1df97e297bff6121c8f801/borp.js#L115-L129

For some reason, it's getting split into test and test-reporter.mjs. And then borp tries to load node_modules/test/ as a reporter.

@jsumners
Copy link
Member

jsumners commented Oct 9, 2024

Unfortunately, I think we are going to need to extend borp to support an rc file in order to get around the various platforms's shell expansions. We should be able to write:

# .borp.yaml

reporters:
  - './test/test-reporter.mjs'

files:
  - 'test/**/*.test.js'
  - 'test/**/*.test.mjs'

@jsumners
Copy link
Member

I have started the work for adding rcfile support to borp at mcollina/borp#105. Pretty much just needs some documentation. But my work day is about to start, so it'll have to wait (feel free to add to it with other PRs).

@jsumners
Copy link
Member

@dancastillo bump borp to 0.18.0 and CI should pass.

@dancastillo dancastillo marked this pull request as ready for review October 11, 2024 18:06
package.json Outdated
"coverage:ci": "tap --coverage-report=html --coverage-report=lcov --allow-incomplete-coverage",
"coverage:ci-check-coverage": "tap replay",
"coverage": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage --lines 100",
"coverage:ci": "nyc --coverage-report=html --coverage-report=lcov borp --reporter=./test/test-reporter.mjs --coverage --check-coverage",
Copy link
Member

Choose a reason for hiding this comment

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

We should be using c8 for coverage.

package.json Outdated
"unit:report": "tap --coverage-report=html --coverage-report=cobertura | tee out.tap",
"citgm": "tap --jobs=1 --timeout=120"
"unit": "borp --reporter=./test/test-reporter.mjs",
"unit:report": "nyc --coverage-report=html --reporter=cobertura borp --reporter=./test/test-reporter.mjs --coverage --check-coverage",
Copy link
Member

Choose a reason for hiding this comment

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

nyc => c8

@dancastillo dancastillo requested a review from jsumners October 12, 2024 02:12
Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

Please add a .borp.yaml file with the following contents:

files:
  - 'test/**/*.test.js'
  - 'test/**/*.test.mjs'

We are missing at least one test suite without that configuration.

package.json Outdated
"unit:report": "tap --coverage-report=html --coverage-report=cobertura | tee out.tap",
"citgm": "tap --jobs=1 --timeout=120"
"unit": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage",
"unit:report": "borp --reporter=./test/test-reporter.mjs --coverage > out.test-report",
Copy link
Member

Choose a reason for hiding this comment

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

This is not equivalent. It should be:

Suggested change
"unit:report": "borp --reporter=./test/test-reporter.mjs --coverage > out.test-report",
"unit:report": "c8 --reporter html borp --reporter=./test/test-reporter.mjs",

package.json Outdated
"coverage:ci": "tap --coverage-report=html --coverage-report=lcov --allow-incomplete-coverage",
"coverage:ci-check-coverage": "tap replay",
"coverage": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage --lines 100",
"coverage:ci": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage",
Copy link
Member

Choose a reason for hiding this comment

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

It should be:

Suggested change
"coverage:ci": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage",
"coverage:ci": "c8 --reporter lcov --reporter html borp --reporter=./test/test-reporter.mjs",

package.json Outdated
"coverage": "npm run unit -- --coverage-report=html",
"coverage:ci": "tap --coverage-report=html --coverage-report=lcov --allow-incomplete-coverage",
"coverage:ci-check-coverage": "tap replay",
"coverage": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage --lines 100",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"coverage": "borp --reporter=./test/test-reporter.mjs --coverage --check-coverage --lines 100",
"coverage": "c8 --reporter html --check-coverage --100 borp --reporter=./test/test-reporter.mjs",

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

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

🎉

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

* Repo: https://github.com/pinojs/pino-http
* License: MIT (https://raw.githubusercontent.com/pinojs/pino-http/master/LICENSE)
*/
/* c8 ignore stop */
Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure these should not be needed

@jsumners
Copy link
Member

I'm going to merge this so work can progress. @dancastillo please determine if the c8 directives Matteo called out are actually needed and follow-up with another PR if they can be removed.

@jsumners jsumners merged commit 025fa7a into fastify:main Oct 13, 2024
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants