From 207b1ca2213e43ae445a30ec4c640a6afa6dc58f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 21:04:47 +0000 Subject: [PATCH 1/4] chore: bump parquet-wasm from 0.6.1 to 0.7.0 Bumps [parquet-wasm](https://github.com/kylebarron/parquet-wasm) from 0.6.1 to 0.7.0. - [Release notes](https://github.com/kylebarron/parquet-wasm/releases) - [Changelog](https://github.com/kylebarron/parquet-wasm/blob/main/CHANGELOG.md) - [Commits](https://github.com/kylebarron/parquet-wasm/compare/v0.6.1...v0.7.0) --- updated-dependencies: - dependency-name: parquet-wasm dependency-version: 0.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87634910cc..4f03a56b18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "inflection": "^3.0.2", "markdown-table": "^3.0.4", "openapi-to-postmanv2": "5.2.0", - "parquet-wasm": "^0.6.1" + "parquet-wasm": "^0.7.0" }, "devDependencies": { "@babel/core": "^7.28.4", @@ -10581,9 +10581,9 @@ } }, "node_modules/parquet-wasm": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/parquet-wasm/-/parquet-wasm-0.6.1.tgz", - "integrity": "sha512-wTM/9Y4EHny8i0qgcOlL9UHsTXftowwCqDsAD8axaZbHp0Opp3ue8oxexbzTVNhqBjFhyhLiU3MT0rnEYnYU0Q==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/parquet-wasm/-/parquet-wasm-0.7.0.tgz", + "integrity": "sha512-BYFzpSNs/Rl++dWuNgwNZTggI8y4ABdO1zblumULrXy/gkC8qCqw4O2l5tfRQHgfAEls50jamqwCFUnWT10QiA==", "license": "MIT OR Apache-2.0" }, "node_modules/parse-json": { diff --git a/package.json b/package.json index fb24097bbd..bc45da76d4 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "inflection": "^3.0.2", "markdown-table": "^3.0.4", "openapi-to-postmanv2": "5.2.0", - "parquet-wasm": "^0.6.1" + "parquet-wasm": "^0.7.0" }, "devDependencies": { "@babel/core": "^7.28.4", From e341dd95618b19ac1ecbafde9821430e95d4ba9a Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 1 Oct 2025 11:41:53 +0100 Subject: [PATCH 2/4] fix: update parquet-wasm import for v0.7.0 compatibility --- tools/spectral/ipa/metrics/scripts/runMetricCollection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/spectral/ipa/metrics/scripts/runMetricCollection.js b/tools/spectral/ipa/metrics/scripts/runMetricCollection.js index d91f63a72b..ec6a92ebc8 100644 --- a/tools/spectral/ipa/metrics/scripts/runMetricCollection.js +++ b/tools/spectral/ipa/metrics/scripts/runMetricCollection.js @@ -2,7 +2,7 @@ import fs from 'node:fs'; import path from 'path'; import { spawnSync } from 'child_process'; import spectral from '@stoplight/spectral-core'; -import { Compression, Table, writeParquet, WriterPropertiesBuilder } from 'parquet-wasm'; +import { Table, writeParquet, WriterPropertiesBuilder } from 'parquet-wasm/esm/parquet_wasm.js'; import { tableFromJSON, tableToIPC } from 'apache-arrow'; import config from '../config.js'; import { runMetricCollectionJob } from '../metricCollection.js'; @@ -58,7 +58,7 @@ runMetricCollectionJob( const wasmTable = Table.fromIPCStream(tableToIPC(table, 'stream')); const parquetUint8Array = writeParquet( wasmTable, - new WriterPropertiesBuilder().setCompression(Compression.GZIP).build() + new WriterPropertiesBuilder().setCompression(2).build() // 2 = GZIP compression ); fs.writeFileSync(config.defaultMetricCollectionResultsFilePath, parquetUint8Array); fs.writeFileSync(path.join(config.defaultOutputsDir, 'warning-count.txt'), results.warnings.count.toString()); From e23d4dd24dc00bbbda6b95b34ddc24f92c1fb7a5 Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 1 Oct 2025 11:42:46 +0100 Subject: [PATCH 3/4] test: add int test for runMetricCollection to ensure no import/syntax regressions --- .../metrics/runMetricCollection.test.js | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js diff --git a/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js b/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js new file mode 100644 index 0000000000..b94ebc4394 --- /dev/null +++ b/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js @@ -0,0 +1,40 @@ +import { describe, expect, it } from '@jest/globals'; +import { spawnSync } from 'child_process'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +/** + * Integration test for runMetricCollection.js script + * + * This test ensures that the script can be run without syntax errors, + * which helps catch issues like: + * - Missing or incorrectly exported dependencies (e.g., parquet-wasm exports) + * - Import/export syntax errors + * - Module resolution problems + */ +describe('tools/spectral/ipa/metrics/scripts/runMetricCollection.js', () => { + it('should run without import/syntax errors', () => { + const scriptPath = path.join(__dirname, '../../metrics/scripts/runMetricCollection.js'); + + // Run the script with Node.js + const result = spawnSync('node', [scriptPath], { + encoding: 'utf8', + timeout: 10000, + }); + + // The script will fail because required files don't exist in the test environment, + // but it should NOT fail with a SyntaxError about missing exports + const output = result.stdout + result.stderr; + + // Check that we don't have import/syntax errors + expect(output).not.toMatch(/SyntaxError.*does not provide an export named/); + expect(output).not.toMatch(/SyntaxError.*Unexpected token/); + + // We expect it to fail with ENOENT for the missing collector results file + // This proves the imports worked correctly + expect(output).toMatch(/ENOENT.*ipa-collector-results-combined\.log/); + }); +}); + From b30ecb43ca1dbefb3670739eaec80b4755d43b2b Mon Sep 17 00:00:00 2001 From: Matt Condon Date: Wed, 1 Oct 2025 11:51:43 +0100 Subject: [PATCH 4/4] prettier --- .../__tests__/metrics/runMetricCollection.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js b/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js index b94ebc4394..9db04343cc 100644 --- a/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js +++ b/tools/spectral/ipa/__tests__/metrics/runMetricCollection.test.js @@ -18,13 +18,14 @@ describe('tools/spectral/ipa/metrics/scripts/runMetricCollection.js', () => { it('should run without import/syntax errors', () => { const scriptPath = path.join(__dirname, '../../metrics/scripts/runMetricCollection.js'); - // Run the script with Node.js - const result = spawnSync('node', [scriptPath], { + // Run the script with Node.js, providing a non-existent file path + // This will cause it to fail early before doing any real work + const result = spawnSync('node', [scriptPath, '/nonexistent/path/to/spec.json'], { encoding: 'utf8', timeout: 10000, }); - // The script will fail because required files don't exist in the test environment, + // The script will fail because the file doesn't exist, // but it should NOT fail with a SyntaxError about missing exports const output = result.stdout + result.stderr; @@ -32,9 +33,8 @@ describe('tools/spectral/ipa/metrics/scripts/runMetricCollection.js', () => { expect(output).not.toMatch(/SyntaxError.*does not provide an export named/); expect(output).not.toMatch(/SyntaxError.*Unexpected token/); - // We expect it to fail with ENOENT for the missing collector results file + // We expect it to fail due to missing files (either OAS file or collector results) // This proves the imports worked correctly - expect(output).toMatch(/ENOENT.*ipa-collector-results-combined\.log/); + expect(output).toMatch(/ENOENT|Could not find/); }); }); -