@decocms/parity 0.34.3 → 0.34.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +26 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -120046,6 +120046,11 @@ function runRegressionSpecs(repoDir, baseUrl) {
120046
120046
  const dir = join49(repoDir, "tests", "qa");
120047
120047
  if (!existsSync36(dir))
120048
120048
  return null;
120049
+ spawnSync2("npx", ["playwright", "install", "chromium"], {
120050
+ cwd: repoDir,
120051
+ encoding: "utf8",
120052
+ timeout: 10 * 60000
120053
+ });
120049
120054
  const config = join49(dir, "playwright.config.ts");
120050
120055
  const args = existsSync36(config) ? ["playwright", "test", "-c", config, "--reporter=json"] : ["playwright", "test", "tests/qa", "--reporter=json"];
120051
120056
  const res = spawnSync2("npx", args, {
@@ -120061,6 +120066,7 @@ function runRegressionSpecs(repoDir, baseUrl) {
120061
120066
  return { errors: [{ message: (res.stderr || res.stdout || "no output").slice(0, 500) }] };
120062
120067
  }
120063
120068
  }
120069
+ var SETUP_FAILURE = /Executable doesn't exist|browserType\.launch|Cannot find module|ERR_MODULE_NOT_FOUND|Please run the following command to download new browsers/i;
120064
120070
  function* specsOf(suite) {
120065
120071
  for (const s of suite.specs ?? [])
120066
120072
  yield { ...s, file: s.file ?? suite.file };
@@ -120086,12 +120092,18 @@ function regressionIssues(report) {
120086
120092
  ];
120087
120093
  }
120088
120094
  const issues = [];
120095
+ const setupFailures = [];
120089
120096
  for (const s of ran) {
120090
120097
  const results = (s.tests ?? []).flatMap((t) => t.results ?? []);
120091
120098
  const last = results[results.length - 1];
120092
120099
  if (!last || last.status === "passed" || last.status === "skipped")
120093
120100
  continue;
120094
120101
  const file = (s.file ?? "").split("/").pop() ?? "";
120102
+ if (SETUP_FAILURE.test(last.error?.message ?? "")) {
120103
+ setupFailures.push(`${file}: ${stripVTControlCharacters(last.error?.message ?? "").split(`
120104
+ `)[0]?.slice(0, 120)}`);
120105
+ continue;
120106
+ }
120095
120107
  issues.push({
120096
120108
  id: `sweep:regression:${file}:${s.title}`,
120097
120109
  severity: "high",
@@ -120106,6 +120118,17 @@ function regressionIssues(report) {
120106
120118
  reproduction: `1. No repositório da loja: \`BASE_URL=<site> npx playwright test -c tests/qa/playwright.config.ts ${file}\`.`
120107
120119
  });
120108
120120
  }
120121
+ if (setupFailures.length)
120122
+ issues.push({
120123
+ id: "sweep:regression:setup-failed",
120124
+ severity: "high",
120125
+ category: "functional",
120126
+ check: "regression-spec",
120127
+ summary: `Suíte de regressão: ${setupFailures.length} teste(s) não chegaram ao site (falha de setup, não do site)`,
120128
+ details: setupFailures.slice(0, 10).join(`
120129
+ `),
120130
+ inconclusive: true
120131
+ });
120109
120132
  return issues;
120110
120133
  }
120111
120134
 
@@ -121288,7 +121311,8 @@ var sweep = program.command("sweep").description("Monthly QA sweep of ONE site:
121288
121311
  });
121289
121312
  sweep.addCommand(new Command("regress").description("Run only the store's tests/qa regression suite against --url — fast, no browser crawl, no LLM; for a daily job or every deploy. Exit 0 all passed, 1 a test failed again (regression), 2 nothing ran (missing install, all skipped). --json for the agent that audits the output.").requiredOption("--url <url>", "Site to test (production, or a PR preview)").requiredOption("--specs <repoDir>", "Store repo checkout with tests/qa installed").option("--json", "Emit one-line JSON", false).action(async (opts) => {
121290
121313
  const issues = regressionIssues(runRegressionSpecs(opts.specs, opts.url));
121291
- const noneRan = issues.some((i) => i.inconclusive);
121314
+ const regressed = issues.some((i) => !i.inconclusive);
121315
+ const unverified = issues.some((i) => i.inconclusive);
121292
121316
  if (opts.json)
121293
121317
  console.log(JSON.stringify({ url: opts.url, issues }));
121294
121318
  else if (!issues.length)
@@ -121296,7 +121320,7 @@ sweep.addCommand(new Command("regress").description("Run only the store's tests/
121296
121320
  else
121297
121321
  for (const i of issues)
121298
121322
  console.log((i.inconclusive ? chalk45.yellow : chalk45.red)(` ${i.summary}`));
121299
- process.exit(noneRan ? 2 : issues.length ? 1 : 0);
121323
+ process.exit(regressed ? 1 : unverified ? 2 : 0);
121300
121324
  }));
121301
121325
  sweep.addCommand(new Command("file").description("File an existing sweep run's findings on the Studio board (default: the newest sweep run). Merges <run>/sweeper-issues.json written by the `sweeper` agent. Dry run unless --yes.").option("--run <runId>", "Sweep run id (default: newest sweep in --output)").option("--output <dir>", "Output directory", "./parity-output").option("--board <name>", "Board: studio", "studio").option("--yes", "Actually create/update cards", false).option("--allow-automation", "File even if the board's triage column starts an agent", false).option("--min-severity <sev>", "critical|high|medium|low", "medium").option("--repo <owner/name>", "Repository to put on the cards").option("--artifacts-url <url>", "Public base URL for this run's artifacts").option("--json", "Emit JSON", false).action(async (opts) => {
121302
121326
  process.exit(await sweepFileCommand(opts));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.34.3",
3
+ "version": "0.34.4",
4
4
  "description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
5
5
  "type": "module",
6
6
  "license": "MIT",