@kakarot-ci/core 0.6.6 → 0.7.0

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
@@ -87,6 +87,7 @@ var KakarotConfigSchema = import_zod.z.object({
87
87
  enableAutoCommit: import_zod.z.boolean().default(true),
88
88
  commitStrategy: import_zod.z.enum(["direct", "branch-pr"]).default("direct"),
89
89
  enablePRComments: import_zod.z.boolean().default(true),
90
+ enableCoverage: import_zod.z.boolean().default(false),
90
91
  debug: import_zod.z.boolean().default(false)
91
92
  });
92
93
 
@@ -2000,7 +2001,7 @@ async function runPullRequest(context) {
2000
2001
  })),
2001
2002
  errors
2002
2003
  };
2003
- if (testFiles.size > 0) {
2004
+ if (config.enableCoverage && testFiles.size > 0) {
2004
2005
  const testRunner = createTestRunner(framework);
2005
2006
  const writtenPaths = Array.from(testFiles.keys());
2006
2007
  try {
@@ -2018,12 +2019,12 @@ async function runPullRequest(context) {
2018
2019
  summary.coverageReport = coverageReport;
2019
2020
  summary.testResults = finalTestResults;
2020
2021
  } else {
2021
- debug("Could not read coverage report (coverage package may be missing)");
2022
+ warn("Could not read coverage report (coverage package may be missing)");
2022
2023
  }
2023
2024
  } catch (err) {
2024
2025
  const errorMessage = err instanceof Error ? err.message : String(err);
2025
2026
  if (errorMessage.includes("coverage") || errorMessage.includes("MISSING DEPENDENCY")) {
2026
- debug(`Coverage collection skipped (missing coverage package): ${errorMessage.split("\n")[0]}`);
2027
+ warn(`Coverage collection failed (coverage package may be missing): ${errorMessage.split("\n")[0]}`);
2027
2028
  } else {
2028
2029
  throw err;
2029
2030
  }
@@ -2120,7 +2121,8 @@ async function commitTests(githubClient, pr, testFiles, config, summary) {
2120
2121
  info(`Committing ${testFiles.length} test file(s)`);
2121
2122
  try {
2122
2123
  if (config.commitStrategy === "branch-pr") {
2123
- const branchName = `kakarot-ci/tests-pr-${pr.number}`;
2124
+ const timestamp = Date.now();
2125
+ const branchName = `kakarot-ci/tests-pr-${pr.number}-${timestamp}`;
2124
2126
  const baseSha = await githubClient.createBranch(branchName, pr.head.ref);
2125
2127
  await githubClient.commitFiles({
2126
2128
  files: testFiles.map((file) => ({