From 6ce23892c8762ffde6fc3198e1e392cd1a72969b Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Wed, 29 Jan 2025 22:40:34 +0000 Subject: [PATCH] chore: add method to filemanager (#11610) testing broken wasm builds --------- Co-authored-by: thunkar --- noir/noir-repo/compiler/fm/src/file_map.rs | 11 ++++++++++- .../integration-tests/web-test-runner.config.mjs | 7 +++++++ noir/noir-repo/yarn.lock | 16 ++++++++-------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/noir/noir-repo/compiler/fm/src/file_map.rs b/noir/noir-repo/compiler/fm/src/file_map.rs index 857c7460fb9..f078ecb8545 100644 --- a/noir/noir-repo/compiler/fm/src/file_map.rs +++ b/noir/noir-repo/compiler/fm/src/file_map.rs @@ -19,6 +19,10 @@ impl PathString { pub fn from_path(p: PathBuf) -> Self { PathString(p) } + + pub fn into_path_buf(self) -> PathBuf { + self.0 + } } impl From for PathString { fn from(pb: PathBuf) -> PathString { @@ -82,7 +86,7 @@ impl FileMap { } pub fn get_name(&self, file_id: FileId) -> Result { - let name = self.files.get(file_id.as_usize())?.name().clone(); + let name = self.get_absolute_name(file_id)?; // See if we can make the file name a bit shorter/easier to read if it starts with the current directory if let Some(current_dir) = &self.current_dir { @@ -93,6 +97,11 @@ impl FileMap { Ok(name) } + + pub fn get_absolute_name(&self, file_id: FileId) -> Result { + let name = self.files.get(file_id.as_usize())?.name().clone(); + Ok(name) + } } impl Default for FileMap { fn default() -> Self { diff --git a/noir/noir-repo/compiler/integration-tests/web-test-runner.config.mjs b/noir/noir-repo/compiler/integration-tests/web-test-runner.config.mjs index 4dfc96dd0a6..1f4d5d7a9a5 100644 --- a/noir/noir-repo/compiler/integration-tests/web-test-runner.config.mjs +++ b/noir/noir-repo/compiler/integration-tests/web-test-runner.config.mjs @@ -26,6 +26,13 @@ export default { // playwrightLauncher({ product: "webkit" }), // playwrightLauncher({ product: "firefox" }), ], + middleware: [async function setGzHeader(ctx, next) { + if (ctx.url.endsWith('.gz')) { + ctx.set('Content-Encoding', 'gzip'); + ctx.res.removeHeader('Content-Length'); + } + await next(); + }], plugins: [ esbuildPlugin({ ts: true, diff --git a/noir/noir-repo/yarn.lock b/noir/noir-repo/yarn.lock index 07b6b677b62..5006813a1b8 100644 --- a/noir/noir-repo/yarn.lock +++ b/noir/noir-repo/yarn.lock @@ -17893,27 +17893,27 @@ __metadata: languageName: node linkType: hard -"playwright-core@npm:1.42.1": - version: 1.42.1 - resolution: "playwright-core@npm:1.42.1" +"playwright-core@npm:1.50.0": + version: 1.50.0 + resolution: "playwright-core@npm:1.50.0" bin: playwright-core: cli.js - checksum: e7081ff0f43b4b9053255109eb1d82164b7c6b55c7d022e25fca935d0f4fc547cb2e02a7b64f0c2a9462729be7bb45edb082f8b038306415944f1061d00d9c90 + checksum: aca5222d7859039bc579b4b860db57c8adc1cc94c3de990ed08cec911bf888e2decb331560bd456991c98222a55c58526187a2a070e6f101fbef43a8e07e1dea languageName: node linkType: hard "playwright@npm:^1.22.2": - version: 1.42.1 - resolution: "playwright@npm:1.42.1" + version: 1.50.0 + resolution: "playwright@npm:1.50.0" dependencies: fsevents: 2.3.2 - playwright-core: 1.42.1 + playwright-core: 1.50.0 dependenciesMeta: fsevents: optional: true bin: playwright: cli.js - checksum: 06c16bcd07d03993126ee6c168bde28c59d3cab7f7d4721eaf57bd5c51e9c929e10a286758de062b5fc02874413ceae2684d14cbb7865c0a51fc8df6d9001ad1 + checksum: 44004e3082433f6024665fcf04bd37cda2b284bd5262682a40a60c66943ccf66f68fbc9ca859908dfd0d117235424580a55e9ccd07e2ad9c30df363b6445448b languageName: node linkType: hard