@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/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var KakarotConfigSchema = z.object({
|
|
|
21
21
|
enableAutoCommit: z.boolean().default(true),
|
|
22
22
|
commitStrategy: z.enum(["direct", "branch-pr"]).default("direct"),
|
|
23
23
|
enablePRComments: z.boolean().default(true),
|
|
24
|
+
enableCoverage: z.boolean().default(false),
|
|
24
25
|
debug: z.boolean().default(false)
|
|
25
26
|
});
|
|
26
27
|
|
|
@@ -1934,7 +1935,7 @@ async function runPullRequest(context) {
|
|
|
1934
1935
|
})),
|
|
1935
1936
|
errors
|
|
1936
1937
|
};
|
|
1937
|
-
if (testFiles.size > 0) {
|
|
1938
|
+
if (config.enableCoverage && testFiles.size > 0) {
|
|
1938
1939
|
const testRunner = createTestRunner(framework);
|
|
1939
1940
|
const writtenPaths = Array.from(testFiles.keys());
|
|
1940
1941
|
try {
|
|
@@ -1952,12 +1953,12 @@ async function runPullRequest(context) {
|
|
|
1952
1953
|
summary.coverageReport = coverageReport;
|
|
1953
1954
|
summary.testResults = finalTestResults;
|
|
1954
1955
|
} else {
|
|
1955
|
-
|
|
1956
|
+
warn("Could not read coverage report (coverage package may be missing)");
|
|
1956
1957
|
}
|
|
1957
1958
|
} catch (err) {
|
|
1958
1959
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1959
1960
|
if (errorMessage.includes("coverage") || errorMessage.includes("MISSING DEPENDENCY")) {
|
|
1960
|
-
|
|
1961
|
+
warn(`Coverage collection failed (coverage package may be missing): ${errorMessage.split("\n")[0]}`);
|
|
1961
1962
|
} else {
|
|
1962
1963
|
throw err;
|
|
1963
1964
|
}
|
|
@@ -2054,7 +2055,8 @@ async function commitTests(githubClient, pr, testFiles, config, summary) {
|
|
|
2054
2055
|
info(`Committing ${testFiles.length} test file(s)`);
|
|
2055
2056
|
try {
|
|
2056
2057
|
if (config.commitStrategy === "branch-pr") {
|
|
2057
|
-
const
|
|
2058
|
+
const timestamp = Date.now();
|
|
2059
|
+
const branchName = `kakarot-ci/tests-pr-${pr.number}-${timestamp}`;
|
|
2058
2060
|
const baseSha = await githubClient.createBranch(branchName, pr.head.ref);
|
|
2059
2061
|
await githubClient.commitFiles({
|
|
2060
2062
|
files: testFiles.map((file) => ({
|