Commit Graph

20 Commits

Author SHA1 Message Date
Yury Zialionka 4431875e86 fix(ci): reduce Windows CLI test contention
Windows CLI unit tests ran 4-at-a-time on the 4-vCPU runner (custom
test-runner default = min(4, cpus)), oversubscribing CPU so heavy
real-server test files blew their per-test timeouts.

- Cap KILO_TEST_CONCURRENCY=2 on Windows (each file gets ~2 vCPU).
- Grow Windows shards 4 -> 6 to absorb the lower per-shard parallelism.
- Shard by observed duration instead of file size, so the two heaviest
  files no longer stack in one shard.
- Raise the Windows per-file kill deadline to 600s (KILO_TEST_FILE_TIMEOUT);
  the heaviest file runs ~270s, only ~30s under the old 300s default.

Scoped to the @kilocode/cli custom runner on Windows only. Linux/macOS
unchanged; the non-CLI/core suite runs via plain 'bun test' and is not
affected (separate lever).
2026-08-11 17:05:11 -06:00
marius-kilocode 3b2686af84 chore(annotations): wrap upstream changes with kilocode_change markers 2026-08-07 14:08:59 +02:00
marius-kilocode dc3af535bb perf(build): optimize cli and extension compile and test times 2026-08-07 14:08:54 +02:00
marius-kilocode c4aebfe305 fix(cli): tolerate process signal failures in test runner 2026-07-24 17:06:49 +02:00
marius-kilocode a33493e722 fix(cli): stabilize cross-platform subprocess tests 2026-07-24 14:23:03 +02:00
dengbushi 88afe3d3c2 fix(cli): clean test runner temp environments (#12232)
* fix(cli): clean test runner temp environments

* fix(cli): clean test environments on runner shutdown

---------

Co-authored-by: marius-kilocode <marius@kilocode.ai>
2026-07-16 12:42:54 +02:00
marius-kilocode 443d510915 test: shard cross-platform CLI suite 2026-07-08 19:59:22 +02:00
marius-kilocode bb9680bc22 chore(ci): reduce test log noise 2026-06-29 16:10:51 +02:00
marius-kilocode 7a156bb205 fix(ci): normalize test paths on Windows 2026-06-23 13:12:17 +02:00
marius-kilocode 31095168d2 test(ci): focus macOS PR coverage 2026-06-23 12:53:03 +02:00
Catriel Müller f40970557f refactor: renegare sdk 2026-05-06 14:26:06 -03:00
Catriel Müller 0de07760a7 ci: bump actions to Node 24 and surface flaky tests to the UI
- Bump all active workflows to action versions that natively target Node 24:
  checkout@v6, setup-node@v6, cache@v5, upload-artifact@v7, download-artifact@v8.
  Resolves the "Node.js 20 is deprecated" warning in CI logs. The kept
  `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24` env stays as a no-op safety net (also
  in upstream OpenCode).
- test-runner: when running under GitHub Actions, emit a `::warning::`
  annotation per flaky file and append a markdown table to
  `$GITHUB_STEP_SUMMARY`. mikepenz/action-junit-report already surfaces
  failures from the JUnit XML, but flakies pass cleanly on retry and were
  invisible in the UI.
2026-05-05 12:53:03 -03:00
Catriel Müller 3f5ed52cd3 refactor: include quarantine on the same runner file 2026-05-05 12:53:03 -03:00
Catriel Müller c21a1b855f fix(cli): produce well-formed JUnit when bun emits nested testsuites
The per-file JUnit merge was walking `<testsuite>` tags by hand and closing
on the first `</testsuite>` it found. Bun's junit reporter nests one
`<testsuite>` per `describe` block inside an outer `<testsuite>` for the
file itself, so the inner close was matched and the outer one got dropped.
Every file contributed one unclosed `<testsuite>` to the merged output,
pushing XML depth up until mikepenz/action-junit-report's sax parser
failed with "Unexpected close tag" (and xmllint with "Excessive depth").

Switch to grabbing everything between the outer `<testsuites ...>` and
`</testsuites>` of each file's XML — nested structure is preserved
verbatim, no custom walking needed. Read aggregate counts from the root
`<testsuites>` attributes so nested `tests="..."` attrs don't get
double-counted either.

Validated locally: `xmllint --noout` passes on the merged output for a
mix of files with and without nested describes.
2026-05-05 12:53:03 -03:00
Catriel Müller 3d063eb47f test(cli): stabilize flaky unit test CI
- Lower default runner concurrency from `os.cpus().length` to `min(4, cpus)`.
  The bottleneck in CI is shared resources (OAuth callback ports, global
  filesystem like `~/.local/share/kilo`), not CPU, so eight parallel Bun
  processes were triggering port/FS races instead of going faster.
- Raise per-test timeout from 30s to 60s. Slow `spawn` on Windows was
  tripping the 30s limit on tests that were just slow, not broken
  (e.g. `session/prompt.test.ts` at ~86s, `provider/provider.test.ts` at ~54s).
- Retry failing files once and surface them as FLAKY in the summary plus a
  dedicated section. Bugs still fail on every attempt; contention recovers.
- Drop CI runners from 8vcpu to 4vcpu to match upstream OpenCode — with
  concurrency capped at 4, the extra cores bought us nothing.
2026-05-05 12:53:03 -03:00
marius-kilocode c0c982befd test(cli): allow explicit quarantined test runs 2026-05-05 13:47:34 +02:00
marius-kilocode 279a86c2b6 test(cli): quarantine flaky MCP OAuth browser tests 2026-05-05 13:43:00 +02:00
kiloconnect[bot] 325bdae8a4 chore(cli): annotate MCP OAuth fix 2026-05-04 14:29:05 +00:00
kiloconnect[bot] acc30a6458 feat(mcp): defer oauth callback server startup
Move the initialization of the MCP OAuth callback server from the layer setup to the point where browser authentication is actually required. This prevents unnecessary port binding when authentication is not needed.

Additionally, improve the test runner's XML parsing to correctly handle multiple testsuite attributes and ensure tags are matched accurately.

- Update `packages/opencode/src/mcp/index.ts` to call `McpOAuthCallback.ensureRunning` only upon `UnauthorizedError`.
- Refactor `packages/opencode/script/test-runner.ts` to use a more robust `open` and `sum` logic for test results.
- Add verification to `packages/opencode/test/mcp/oauth-auto-connect.test.ts` to ensure the callback server remains inactive when not needed.
2026-05-04 14:14:09 +00:00
Catriel Müller d039bdf6c3 feat: test runner 2026-04-15 15:11:33 -03:00