Skip to content

Commit 87bc9ce

Browse files
committed
fix(sea): make @napi-rs/cli optional + prettier-format loader test
Two CI failures, both unrelated to driver behavior: 1. unit-test/lint/e2e intermittently failed at `npm ci` with ECONNRESET fetching @napi-rs/cli@2.18.4 from the internal npm proxy (cold-cache matrix jobs; the warm-cache node-14 job kept passing). @napi-rs/cli is only used by `build:native`, which CI never runs. Move it from devDependencies to optionalDependencies — matching the existing lz4 pattern — so a proxy hiccup is a non-fatal skip instead of failing the whole install. `build:native`'s `npx --no-install` still resolves it on dev machines where the optional install succeeds. 2. prettier flagged loader.test.ts: the two-arg `new SeaNativeLoader(cb, fn)` calls needed multi-line formatting. Ran prettier --write. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent cee1e14 commit 87bc9ce

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
],
5050
"license": "Apache-2.0",
5151
"devDependencies": {
52-
"@napi-rs/cli": "2.18.4",
5352
"@types/chai": "^4.3.14",
5453
"@types/http-proxy": "^1.17.14",
5554
"@types/lz4": "^0.6.4",
@@ -92,6 +91,7 @@
9291
"winston": "^3.8.2"
9392
},
9493
"optionalDependencies": {
95-
"lz4": "^0.6.5"
94+
"lz4": "^0.6.5",
95+
"@napi-rs/cli": "2.18.4"
9696
}
9797
}

tests/unit/sea/loader.test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,22 @@ describe('SeaNativeLoader', () => {
126126
describe('Node-version gate', () => {
127127
it('fails closed on a Node version below the floor', () => {
128128
let loadCalled = false;
129-
const loader = new SeaNativeLoader(() => {
130-
loadCalled = true;
131-
return stubBinding();
132-
}, () => 16);
129+
const loader = new SeaNativeLoader(
130+
() => {
131+
loadCalled = true;
132+
return stubBinding();
133+
},
134+
() => 16,
135+
);
133136
expect(() => loader.get()).to.throw(/requires Node >=18/);
134137
expect(loadCalled, 'load() must not be attempted on an unsupported Node').to.equal(false);
135138
});
136139

137140
it('fails closed when the Node version is unparseable (NaN)', () => {
138-
const loader = new SeaNativeLoader(() => stubBinding(), () => NaN);
141+
const loader = new SeaNativeLoader(
142+
() => stubBinding(),
143+
() => NaN,
144+
);
139145
expect(() => loader.get()).to.throw(/requires Node >=18/);
140146
});
141147
});

0 commit comments

Comments
 (0)