@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/cli/index.js +6 -4
- package/dist/cli/index.js.map +2 -2
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +6 -4
- package/dist/index.js.map +2 -2
- package/dist/src/types/config.d.ts +3 -0
- package/dist/src/types/config.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -356,6 +356,7 @@ var KakarotConfigSchema = z.object({
|
|
|
356
356
|
enableAutoCommit: z.boolean().default(true),
|
|
357
357
|
commitStrategy: z.enum(["direct", "branch-pr"]).default("direct"),
|
|
358
358
|
enablePRComments: z.boolean().default(true),
|
|
359
|
+
enableCoverage: z.boolean().default(false),
|
|
359
360
|
debug: z.boolean().default(false)
|
|
360
361
|
});
|
|
361
362
|
|
|
@@ -1944,7 +1945,7 @@ async function runPullRequest(context) {
|
|
|
1944
1945
|
})),
|
|
1945
1946
|
errors
|
|
1946
1947
|
};
|
|
1947
|
-
if (testFiles.size > 0) {
|
|
1948
|
+
if (config.enableCoverage && testFiles.size > 0) {
|
|
1948
1949
|
const testRunner = createTestRunner(framework);
|
|
1949
1950
|
const writtenPaths = Array.from(testFiles.keys());
|
|
1950
1951
|
try {
|
|
@@ -1962,12 +1963,12 @@ async function runPullRequest(context) {
|
|
|
1962
1963
|
summary.coverageReport = coverageReport;
|
|
1963
1964
|
summary.testResults = finalTestResults;
|
|
1964
1965
|
} else {
|
|
1965
|
-
|
|
1966
|
+
warn("Could not read coverage report (coverage package may be missing)");
|
|
1966
1967
|
}
|
|
1967
1968
|
} catch (err) {
|
|
1968
1969
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1969
1970
|
if (errorMessage.includes("coverage") || errorMessage.includes("MISSING DEPENDENCY")) {
|
|
1970
|
-
|
|
1971
|
+
warn(`Coverage collection failed (coverage package may be missing): ${errorMessage.split("\n")[0]}`);
|
|
1971
1972
|
} else {
|
|
1972
1973
|
throw err;
|
|
1973
1974
|
}
|
|
@@ -2064,7 +2065,8 @@ async function commitTests(githubClient, pr, testFiles, config, summary) {
|
|
|
2064
2065
|
info(`Committing ${testFiles.length} test file(s)`);
|
|
2065
2066
|
try {
|
|
2066
2067
|
if (config.commitStrategy === "branch-pr") {
|
|
2067
|
-
const
|
|
2068
|
+
const timestamp = Date.now();
|
|
2069
|
+
const branchName = `kakarot-ci/tests-pr-${pr.number}-${timestamp}`;
|
|
2068
2070
|
const baseSha = await githubClient.createBranch(branchName, pr.head.ref);
|
|
2069
2071
|
await githubClient.commitFiles({
|
|
2070
2072
|
files: testFiles.map((file) => ({
|