@quikit/quikpilot-runner 9.3.0-rc.48 → 9.3.0-rc.49

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/README.md CHANGED
@@ -164,6 +164,8 @@ wrong (a field that arrives from a database row or a request), so it only warns
164
164
 
165
165
  **9.3.0-rc.46 — the existing tests to read first include the ones that reach the code through one file in between (QUIKTR-1845).** On the live bug-6 run (QTRIA-17) the design changed `lib/services/issueFilters.ts`, and the two tests that assert the bug import `app/api/issues/route.ts`, which imports it, so the list of existing tests the AI reads before writing (`testsToCheck`, rc.44) was empty. When fewer than 3 test files are found by name or a direct import, the runner now takes one more step: of the files the tests import (code, not a test, not under a denied path; the 150 most shared first) it keeps the ones that import a changed file, and adds the tests that import them, after the others and up to 10 in all. A file in between imported by more than 12 tests only brings the tests named after it (a route by its folder) or after the changed file. Paths only, as before. With 3 or more found the list is exactly as in rc.45. Also in rc.46: everything in rc.45. Nothing else changes.
166
166
 
167
+ **9.3.0-rc.49 - Go and Python runs are no longer failed by the test placement check, and a push retries (QUIKTR-1884, QUIKTR-1885).** The placement check (before the write) compared a test file with the files named in the repository's own test report, and took a testcase's classname for a file. In JavaScript a classname is a file path; in Go it is the package path ("github.com/acme/app") and in pytest a dotted module ("tests.test_auth.TestLogin"), so the report held names but no file, and every real Go or Python test file was called "never discovered by the test runner" - found on the first live Go run (decimal). Now only a classname that looks like a file counts; a report with no file in it means "cannot tell" and the check steps aside, as its own description always said (the later check that every claimed case was really run still decides). Also: a push right after the installation token was minted can be answered "Repository not found" by GitHub although the token works seconds later (a test-change proposal failed that way on two live QuikIT runs in a row). The push now waits and tries again up to three more times (3, 6 and 12 seconds), only for that exact answer; any other failure fails at once as before, and each retry is logged (git.push_retry, git.push_retry_ok). Also in rc.49: everything in rc.48.
168
+
167
169
  **9.3.0-rc.47 — an approved test change that does not fit is named, and can go back to a person (QUIKTR-1844).** On the live bug-3 re-run (QTRIA-16, 26 Oct) a person approved one change to a table test (`toBe(401)` became `toBe(200)` for all 11 rows); with the code complete, 10 rows still failed, the failure said only "existing tests that may expect the old behaviour", and the fix turn, seeing names only, took the approval as proof the test was right and gave up with a stop left. Now, when rows of a test a person approved changing still fail at the final check: the failure message says so first (`the test change approved for <file>: "<title>" does not fit 10 of its 11 rows (now: "expected 404 to be 200")`); the fix turn lists those rows first and shows the first line of each failure (scrubbed, at most 120 characters; approved tests only, every other existing test is still shown by name only); the test is sent as `stillFailing: true` in `decidedTests` (contract §38.12); and, while stops remain, the AI may report that test once more with a change written against the approved text. The revised proposal's line carries `revises` (the commit it replaces) and `misfit` (counts and up to 3 short lines), its message says "This revises the change approved in <sha>", and when approved it replaces the earlier change instead of being merged with it. A revision is checked like any report (inside the test, expectations only). Needs the AI service with §38.12 (it refuses `stillFailing` otherwise, so release that first). A run with no approved test changes, or whose approved tests pass, is exactly as in rc.46. Also in rc.47: everything in rc.46.
168
170
 
169
171
  **9.3.0-rc.48 - the final test check never passes a change it could not check (QUIKTR-1698).** Until rc.47 the gate compared the JUnit report from before the change with the one after it, and when either was missing it let the change through, even when the tests had failed: the Test command's own result was captured and never read. Now (src/testVerification.ts): with a report on both sides, the test-by-test comparison decides as before; with no report on either side, the Test command's result decides - passed before and after: the change goes through with a note in the pull request that it was checked by the Test command's result only; passed before and failed after: the run fails (no test can be named, so no fix is tried); already failing before: the run fails as "could not check this change". A report on one side only, or no Test command at all, also fails as "could not check this change". Every test run now reads only a report it wrote itself (a report left by an earlier run, or committed to the repository, was read by runs without a time limit). Nothing pushed in any failing case. Test results from any language (QUIKTR-1700): every JUnit report the test run wrote is read, wherever it is and whatever its name (found by being a <testsuites>/<testsuite> document; Maven's one file per class, Gradle's build/test-results, pytest, .NET, RSpec, PHPUnit), merged, and uploaded to QuikTest as one document; dependency folders and QuikPilot's own failure copy are skipped. A new test no longer needs [QP-...] in its name: the AI lists each case's test in caseTests (file and test name) with its DONE answer (src/caseTags.ts), and the runner tags the matching test cases with [QP-...] in the results it reads and the report it uploads, so every existing check and QuikTest match them as before; the reproduce-first and hand-over checks accept a declared test. Failure locations are read from Python, Go, C#, RSpec and PHP output too. A one-file run with no report answers with the Test command's result (no_report with reason test_command_passed/test_command_failed), and a failed one counts as red evidence for the cases declared in that file. A classname is a file only with a source extension (a Go package path is not). Composer/PHP variables reach the project's commands. Needs the AI service with contract 38.13 for caseTests (an older one ignores it). Also in rc.48: everything in rc.47.
package/dist/index.js CHANGED
@@ -24665,14 +24665,31 @@ function clearCheckoutExtraHeader() {
24665
24665
  if (status !== 5) throw err;
24666
24666
  }
24667
24667
  }
24668
- function push(branch, installationToken) {
24668
+ var PUSH_RETRY_DELAYS_MS = [3e3, 6e3, 12e3];
24669
+ var REPOSITORY_NOT_FOUND_RE = /Repository not found/i;
24670
+ function sleepSync(ms) {
24671
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
24672
+ }
24673
+ function push(branch, installationToken, sleep = sleepSync) {
24669
24674
  clearCheckoutExtraHeader();
24670
24675
  const basicAuth = Buffer.from(`x-access-token:${installationToken}`).toString("base64");
24671
- git(["push", "--set-upstream", "origin", branch], {
24672
- GIT_CONFIG_COUNT: "1",
24673
- GIT_CONFIG_KEY_0: "http.https://github.com/.extraheader",
24674
- GIT_CONFIG_VALUE_0: `AUTHORIZATION: basic ${basicAuth}`
24675
- });
24676
+ for (let attempt2 = 0; ; attempt2 += 1) {
24677
+ try {
24678
+ git(["push", "--set-upstream", "origin", branch], {
24679
+ GIT_CONFIG_COUNT: "1",
24680
+ GIT_CONFIG_KEY_0: "http.https://github.com/.extraheader",
24681
+ GIT_CONFIG_VALUE_0: `AUTHORIZATION: basic ${basicAuth}`
24682
+ });
24683
+ if (attempt2 > 0) console.log(JSON.stringify({ event: "git.push_retry_ok", attempts: attempt2 + 1 }));
24684
+ return;
24685
+ } catch (err) {
24686
+ const delay = PUSH_RETRY_DELAYS_MS[attempt2];
24687
+ const said = `${err instanceof Error ? err.message : String(err)} ${String(err.stderr ?? "")}`;
24688
+ if (delay === void 0 || !REPOSITORY_NOT_FOUND_RE.test(said)) throw err;
24689
+ console.log(JSON.stringify({ event: "git.push_retry", attempt: attempt2 + 1, waitMs: delay }));
24690
+ sleep(delay);
24691
+ }
24692
+ }
24676
24693
  }
24677
24694
 
24678
24695
  // src/testHistory.ts
@@ -34426,7 +34443,7 @@ function parseJUnitOutcomes(xml) {
34426
34443
  }
34427
34444
  const file = FILE_ATTR_RE.exec(attrs)?.[1];
34428
34445
  if (file) discoveredFiles.add(normalizeSlashes(file));
34429
- if (classname) discoveredFiles.add(normalizeSlashes(classname));
34446
+ if (classname && looksLikeFilePath(classname.trim())) discoveredFiles.add(normalizeSlashes(classname));
34430
34447
  if (!file?.trim() && !(classname && looksLikeFilePath(classname.trim()))) unmappedEntries += 1;
34431
34448
  const bracket = QP_TOKEN_BRACKET_RE.exec(name)?.[1];
34432
34449
  if (bracket) {
@@ -45291,7 +45308,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
45291
45308
  var REPORT_COPY = "final-test-report.xml";
45292
45309
  var MAX_REPORT_BYTES = 5 * 1024 * 1024;
45293
45310
  var MAX_FILES = 200;
45294
- var RUNNER_VERSION = true ? "9.3.0-rc.48" : "dev";
45311
+ var RUNNER_VERSION = true ? "9.3.0-rc.49" : "dev";
45295
45312
  function safeDestination(base, repoPath) {
45296
45313
  if (!repoPath || (0, import_node_path24.isAbsolute)(repoPath)) return null;
45297
45314
  const destination = (0, import_node_path24.resolve)(base, repoPath);