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

chore: migrate from tap to node:test and c8 #117

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

tpreviero
Copy link
Contributor

@tpreviero tpreviero commented Sep 26, 2024

Migrate from tap to node:test and c8.

Co-Authored-By: Pietro Marchini [email protected]

Checklist

fastify.register(fastifyElasticsearch, { node: 'http://localhost:9200' })

await fastify.ready()
t.equal(fastify.elastic.name, 'elasticsearch-js')
assert.equal(fastify.elastic.name, 'elasticsearch-js')
Copy link
Contributor

Choose a reason for hiding this comment

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

you should use t.assert.equal etc. and not directly assert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accessing t.assert doesn't work as it ends up giving TypeError [Error]: Cannot read properties of undefined (reading 'equal').
Any idea on how to solve it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with 85ac08f, but I'm not able to run tests locally anymore because of the error reported previously.

Choose a reason for hiding this comment

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

you should use t.assert.equal etc. and not directly assert

Hey @Uzlopak, thanks for the review 😁 Could you explain the rationale behind using t.assert instead of assert?

Choose a reason for hiding this comment

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

btw,
image
I've just tested, and the context assert is not present in Node 20.12 but is present in 20.17.
It is also not exposed in Node 18.
I suggest using import assert from 'node:assert' if we want to maintain CI compatibility for Node 18, 20, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see that Node 18 was removed from plugins-ci-elasticsearch.yml few months back.
Maybe we should move from the v4.2.0 to a more recent one? v5.0.0 seems to contain the Node 18 removal.

Copy link
Contributor Author

@tpreviero tpreviero Sep 27, 2024

Choose a reason for hiding this comment

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

Opened #118 #119 #120 to address the plugins-ci-elasticsearch.yml reference update.

Choose a reason for hiding this comment

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

The difference between t.assert and assert is that t.assert works with t.plan for assertion counting.
I think in this case does not make any difference.

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

Thanks!

Please see: #117 (comment)

Copy link
Member

@dancastillo dancastillo left a comment

Choose a reason for hiding this comment

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

Can you remove .taprc

@tpreviero
Copy link
Contributor Author

Can you remove .taprc

Done with ba3fdc1

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

ci is red

@tpreviero
Copy link
Contributor Author

ci is red

With the very same error I got locally

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

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

You should be able to rebase

@gurgunday gurgunday requested a review from a team October 4, 2024 06:26
@marco-ippolito
Copy link

marco-ippolito commented Oct 4, 2024

FYI Node has native support for code coverage thresholds nodejs/node#54429 from Node 22 (which will become LTS the 29th of October)

@marco-ippolito
Copy link

FYI Node has native support for code coverage threshold nodejs/node#54429 from Node 22 (which will become LTS the 29th of October)

@climba03003
Copy link
Member

FYI Node has native support for code coverage thresholds nodejs/node#54429 from Node 22 (which will become LTS the 29th of October)

Then, it is not an option for us until it backported to node@20.

@marco-ippolito
Copy link

marco-ippolito commented Oct 4, 2024

FYI Node has native support for code coverage thresholds nodejs/node#54429 from Node 22 (which will become LTS the 29th of October)

Then, it is not an option for us until it backported to node@20.

It will not be backported unless its already in 20.18.0
v20 is in maintanance mode, this was the last release as active LTS

@gurgunday gurgunday merged commit 9e5aeea into fastify:master Oct 4, 2024
6 checks passed
@climba03003
Copy link
Member

It will not be backported unless its already in 20.18.0
v20 is in maintanance mode, this was the last release as active LTS

I am only saying we cannot use this feature because it is not in the node@20.
So, it becomes a NO for the entire life-time of fastify@5 which will be a few years (maybe).

By that time, fastify@6 the built-in coverage should be stable (maybe) and ready for use.

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.

7 participants