• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobotWebTools / rclnodejs / 22704446385
86%

Build:
DEFAULT BRANCH: develop
Ran 05 Mar 2026 06:13AM UTC
Jobs 1
Files 50
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Mar 2026 05:53AM UTC coverage: 85.481%. Remained the same
22704446385

push

github

web-flow
Fix bugs in rosidl_gen and index.js, add tests (#1412)

This PR fixes a couple of correctness issues in message generation and generator version detection, and adds targeted tests to prevent regressions in `rosidl_gen` primitive type initialization.

**Changes:**

**index.js**
- Fix file descriptor leak in `getCurrentGeneratorVersion()`: replaced `fs.open()` followed by nested `fs.readFile()` with a single `fs.readFile()` call, eliminating the unclosed fd when the file exists
- Add `try/catch` around `JSON.parse()` to properly reject on malformed JSON instead of throwing an unhandled exception

**rosidl_gen/primitive_types.js**
- Fix operator precedence bug in `initString()`: `(!str) instanceof Buffer` always evaluated to `false` (negating `str` first, then checking if `true`/`false` is an instance of `Buffer`); corrected to `!(str instanceof Buffer)` so the type guard works as intended
- Same fix for the `(!str) instanceof StringRefStruct` check in the `own=false` branch

**rosidl_gen/packages.js**
- Fix TOCTOU race in `generateMsgForSrv()`: replaced `existsSync()` + `mkdirSync()` with `mkdirSync(path, { recursive: true })`, which is atomic and won't throw if the directory already exists

**test/test-primitive-types.js** *(new)*
- Add 9 unit tests for `initString()` covering both `own=true` and `own=false` branches: rejects invalid types (number, string, null, undefined, Buffer-when-struct-expected) and correctly initializes a valid `StringRefStruct`

Fix: #1411

1380 of 1755 branches covered (78.63%)

Branch coverage included in aggregate %.

2859 of 3204 relevant lines covered (89.23%)

448.55 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22704446385.1 05 Mar 2026 06:13AM UTC 50
85.48
GitHub Action Run
Source Files on build 22704446385
  • Tree
  • List 50
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #22704446385
  • 88773046 on github
  • Prev Build on develop (#22702484015)
  • Next Build on develop (#22705943136)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc