@kakarot-ci/core 0.6.4 → 0.6.5

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.
package/dist/index.cjs CHANGED
@@ -230,6 +230,8 @@ var GitHubClient = class {
230
230
  this.retryDelay = 1e3;
231
231
  this.owner = options.owner;
232
232
  this.repo = options.repo;
233
+ const originalConsoleError = console.error;
234
+ const originalConsoleWarn = console.warn;
233
235
  this.octokit = new import_rest.Octokit({
234
236
  auth: options.token,
235
237
  request: {
@@ -237,6 +239,8 @@ var GitHubClient = class {
237
239
  retryAfter: this.retryDelay / 1e3
238
240
  }
239
241
  });
242
+ console.error = originalConsoleError;
243
+ console.warn = originalConsoleWarn;
240
244
  }
241
245
  /**
242
246
  * Retry wrapper with exponential backoff
@@ -435,7 +439,23 @@ var GitHubClient = class {
435
439
  * Check if a file exists in the repository
436
440
  */
437
441
  async fileExists(ref, path) {
442
+ const originalError = console.error;
443
+ const originalWarn = console.warn;
444
+ const suppressedError = (...args) => {
445
+ const message = args.join(" ");
446
+ if (!message.includes("404") && !message.includes("Not Found")) {
447
+ originalError(...args);
448
+ }
449
+ };
450
+ const suppressedWarn = (...args) => {
451
+ const message = args.join(" ");
452
+ if (!message.includes("404") && !message.includes("Not Found")) {
453
+ originalWarn(...args);
454
+ }
455
+ };
438
456
  try {
457
+ console.error = suppressedError;
458
+ console.warn = suppressedWarn;
439
459
  await this.octokit.rest.repos.getContent({
440
460
  owner: this.owner,
441
461
  repo: this.repo,
@@ -455,6 +475,9 @@ var GitHubClient = class {
455
475
  }
456
476
  }
457
477
  throw err;
478
+ } finally {
479
+ console.error = originalError;
480
+ console.warn = originalWarn;
458
481
  }
459
482
  }
460
483
  /**
@@ -1982,21 +2005,31 @@ async function runPullRequest(context) {
1982
2005
  if (testFiles.size > 0) {
1983
2006
  const testRunner = createTestRunner(framework);
1984
2007
  const writtenPaths = Array.from(testFiles.keys());
1985
- info("Running tests with coverage...");
1986
- const finalTestResults = await testRunner.runTests({
1987
- testFiles: writtenPaths,
1988
- framework,
1989
- packageManager,
1990
- projectRoot,
1991
- coverage: true
1992
- });
1993
- const coverageReport = readCoverageReport(projectRoot, framework);
1994
- if (coverageReport) {
1995
- info(`Coverage collected: ${coverageReport.total.lines.percentage.toFixed(1)}% lines`);
1996
- summary.coverageReport = coverageReport;
1997
- summary.testResults = finalTestResults;
1998
- } else {
1999
- warn("Could not read coverage report");
2008
+ try {
2009
+ info("Running tests with coverage...");
2010
+ const finalTestResults = await testRunner.runTests({
2011
+ testFiles: writtenPaths,
2012
+ framework,
2013
+ packageManager,
2014
+ projectRoot,
2015
+ coverage: true
2016
+ });
2017
+ const coverageReport = readCoverageReport(projectRoot, framework);
2018
+ if (coverageReport) {
2019
+ info(`Coverage collected: ${coverageReport.total.lines.percentage.toFixed(1)}% lines`);
2020
+ summary.coverageReport = coverageReport;
2021
+ summary.testResults = finalTestResults;
2022
+ } else {
2023
+ warn("Could not read coverage report");
2024
+ }
2025
+ } catch (err) {
2026
+ const errorMessage = err instanceof Error ? err.message : String(err);
2027
+ if (errorMessage.includes("coverage") || errorMessage.includes("MISSING DEPENDENCY")) {
2028
+ warn(`Coverage collection failed (likely missing coverage package): ${errorMessage}`);
2029
+ warn("Continuing without coverage report");
2030
+ } else {
2031
+ throw err;
2032
+ }
2000
2033
  }
2001
2034
  }
2002
2035
  if (config.enableAutoCommit && testFiles.size > 0) {