Skip to content

Commit 7413612

Browse files
chore(ipa): bump parquet-wasm from 0.6.1 to 0.7.0 (#969)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matt Condon <[email protected]>
1 parent 7240f64 commit 7413612

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"inflection": "^3.0.2",
3636
"markdown-table": "^3.0.4",
3737
"openapi-to-postmanv2": "5.2.0",
38-
"parquet-wasm": "^0.6.1"
38+
"parquet-wasm": "^0.7.0"
3939
},
4040
"devDependencies": {
4141
"@babel/core": "^7.28.4",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { describe, expect, it } from '@jest/globals';
2+
import { spawnSync } from 'child_process';
3+
import path from 'path';
4+
import { fileURLToPath } from 'url';
5+
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
7+
8+
/**
9+
* Integration test for runMetricCollection.js script
10+
*
11+
* This test ensures that the script can be run without syntax errors,
12+
* which helps catch issues like:
13+
* - Missing or incorrectly exported dependencies (e.g., parquet-wasm exports)
14+
* - Import/export syntax errors
15+
* - Module resolution problems
16+
*/
17+
describe('tools/spectral/ipa/metrics/scripts/runMetricCollection.js', () => {
18+
it('should run without import/syntax errors', () => {
19+
const scriptPath = path.join(__dirname, '../../metrics/scripts/runMetricCollection.js');
20+
21+
// Run the script with Node.js, providing a non-existent file path
22+
// This will cause it to fail early before doing any real work
23+
const result = spawnSync('node', [scriptPath, '/nonexistent/path/to/spec.json'], {
24+
encoding: 'utf8',
25+
timeout: 10000,
26+
});
27+
28+
// The script will fail because the file doesn't exist,
29+
// but it should NOT fail with a SyntaxError about missing exports
30+
const output = result.stdout + result.stderr;
31+
32+
// Check that we don't have import/syntax errors
33+
expect(output).not.toMatch(/SyntaxError.*does not provide an export named/);
34+
expect(output).not.toMatch(/SyntaxError.*Unexpected token/);
35+
36+
// We expect it to fail due to missing files (either OAS file or collector results)
37+
// This proves the imports worked correctly
38+
expect(output).toMatch(/ENOENT|Could not find/);
39+
});
40+
});

tools/spectral/ipa/metrics/scripts/runMetricCollection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'node:fs';
22
import path from 'path';
33
import { spawnSync } from 'child_process';
44
import spectral from '@stoplight/spectral-core';
5-
import { Compression, Table, writeParquet, WriterPropertiesBuilder } from 'parquet-wasm';
5+
import { Table, writeParquet, WriterPropertiesBuilder } from 'parquet-wasm/esm/parquet_wasm.js';
66
import { tableFromJSON, tableToIPC } from 'apache-arrow';
77
import config from '../config.js';
88
import { runMetricCollectionJob } from '../metricCollection.js';
@@ -58,7 +58,7 @@ runMetricCollectionJob(
5858
const wasmTable = Table.fromIPCStream(tableToIPC(table, 'stream'));
5959
const parquetUint8Array = writeParquet(
6060
wasmTable,
61-
new WriterPropertiesBuilder().setCompression(Compression.GZIP).build()
61+
new WriterPropertiesBuilder().setCompression(2).build() // 2 = GZIP compression
6262
);
6363
fs.writeFileSync(config.defaultMetricCollectionResultsFilePath, parquetUint8Array);
6464
fs.writeFileSync(path.join(config.defaultOutputsDir, 'warning-count.txt'), results.warnings.count.toString());

0 commit comments

Comments
 (0)