Skip to content

#7180: Upgrade Cucumber-js to v12#7221

Merged
DennisOSRM merged 60 commits intoProject-OSRM:masterfrom
afarber:7180-upgrade-cucumber-js
Aug 26, 2025
Merged

#7180: Upgrade Cucumber-js to v12#7221
DennisOSRM merged 60 commits intoProject-OSRM:masterfrom
afarber:7180-upgrade-cucumber-js

Conversation

@afarber
Copy link
Copy Markdown
Contributor

@afarber afarber commented Aug 17, 2025

Issue

Fix the issue #7180 by

  • Upgrade to Cucumber-js v12.1.0 and convert to modern ESM classes
  • Rename remaining CommonJS files to *.cjs
  • Use flatbuffers 24.3.25 npm package, matching third_party/flatbuffers
  • Use function instead of arrow syntax for step definitions
  • Convert the cucumber config file to the new format
  • Each scenario gets new World object, adjust for that
  • Use After instead of process hooks
  • Add 1 line comments to ./feature/lib/.js ./feature/support/.js ./feature/step_definitions/*.js files
  • Add features/testbot/hello.feature and features/step_definitions/hello.js to test Cucumber-js
  • Add .prettierrc matching the eslint.config.js

Please read our documentation on release and version management.
If your PR is still work in progress please attach the relevant label.

Tasklist

Requirements / Relations

afarber added 30 commits August 16, 2025 18:28
…g.js, use fs.constants.F_OK to avoid warnings
Fix line numbers in getScenarioID
@afarber afarber marked this pull request as ready for review August 23, 2025 18:50
@DennisOSRM
Copy link
Copy Markdown
Collaborator

nice!let me know when this is ready for review

@afarber
Copy link
Copy Markdown
Contributor Author

afarber commented Aug 25, 2025

Hi @DennisOSRM yes, it is ready for review, please tell me what to improve.

It is difficult to upgrade the 9 years old code cleanly...

But I think it would be good to merge this PR now, because all tests pass: osrm-npm-test.txt

And then clean up more in subsequent PRs (for example in this PR I have copied fbresult_generated.js to fbresult_generated.cjs, but in subsequent PR we could convert all remaining *.cjs files to *.js, from CommonJS to ESM)

@DennisOSRM
Copy link
Copy Markdown
Collaborator

Sounds good. Would you mind opening tickets after the merge s.t. we have it in the backlog.

Copy link
Copy Markdown
Collaborator

@DennisOSRM DennisOSRM left a comment

Choose a reason for hiding this comment

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

Looks ready to me. Only minor comments

- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick: is it necessary to bump the node version for these changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Node.js 18 has reached end-of-life 30 Apr 2025: https://endoflife.date/nodejs

And also I was getting the warnings from the CI, that cucumber js needs Node.js 20+

Comment thread .prettierrc
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this be part of the PR or is it unrelated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file could be omitted, but in my VS Code I use prettier extension (which is popular with frontend devs) and it was annoyingly reformatting the file on each save and then lint was not happy.

With this .prettierrc which matches the eslint.config.js I did not have the annoyance.

Let's keep it in the PR if you don't mind?

@afarber
Copy link
Copy Markdown
Contributor Author

afarber commented Aug 25, 2025

Yes, I will create new tickets on further cleanup/improvements during this week

@DennisOSRM DennisOSRM merged commit 14e1713 into Project-OSRM:master Aug 26, 2025
21 checks passed
@afarber afarber deleted the 7180-upgrade-cucumber-js branch August 26, 2025 10:50
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.

2 participants