From 75fc20981a2cf300c15c888c94ada62c7e80e2ce Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 22 Dec 2022 13:12:08 -0500 Subject: [PATCH] Fix test262 for realsies The github action was exceeding maximum allowed memory size because we were no longer grouping messages correctly prior to formatting them in the script. I think these were introduced when we integrated the Babel plugin into the preprocessor. This PR strips out filenames from the message so they can be grouped together again. Also added some light comments Test plan: manually ran `scripts/test262.sh` and verified that the JSON was grouped together correctly --- compiler/forget/scripts/test262-preprocessor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/forget/scripts/test262-preprocessor.js b/compiler/forget/scripts/test262-preprocessor.js index 1967756233..25571ec7e0 100644 --- a/compiler/forget/scripts/test262-preprocessor.js +++ b/compiler/forget/scripts/test262-preprocessor.js @@ -15,7 +15,10 @@ module.exports = (test) => { throw new Error("Codegen returned an empty string"); } } catch (error) { - error.message = error.message.replace(/ \(\d+:\d+\)/, ""); + // We use the `stderr` output to group errors so we can count them, so we need to dedupe errors + // that are the same but differ slightly + error.message = error.message.replace(/ \(\d+:\d+\)/, ""); // some errors report line numbers + error.message = error.message.replace(/\/.*\.js:\s/, ""); // babel seems to output filenames test.result = { stderr: `${error.name}: ${error.message}\n`, stdout: "",