Repository navigation
test(ci): shard cross-platform CLI suite #12051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
443d510
test: shard cross-platform CLI suite
marius-kilocode 6339835
test(ci): balance remaining macOS bottleneck
marius-kilocode 736850e
chore(ci): clean up sharded test checks
marius-kilocode 07c136d
test(ci): focus macOS on native coverage
marius-kilocode 276c547
chore(cli): fix watcher change markers
marius-kilocode 6db2f20
Merge branch 'main' into hammerhead-door
marius-kilocode c340790
test(cli): wait for persistent output before reload
marius-kilocode b0623a6
fix(ci): restore required unit status
marius-kilocode 6c96179
test(ci): trim platform-neutral macOS coverage
marius-kilocode 40c8412
test(cli): normalize profile fixture paths
marius-kilocode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # kilocode_change - new file | ||
| name: "Setup Linux Sandbox" | ||
| description: "Build the Linux bubblewrap helper" | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Setup Zig | ||
| run: | | ||
| curl --fail --location --retry 3 \ | ||
| https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz \ | ||
| --output "$RUNNER_TEMP/zig.tar.xz" | ||
| echo "473ec26806133cf4d1918caf1a410f8403a13d979726a9045b421b685031a982 $RUNNER_TEMP/zig.tar.xz" | sha256sum --check --status | ||
| tar -xJf "$RUNNER_TEMP/zig.tar.xz" -C "$RUNNER_TEMP" | ||
| echo "$RUNNER_TEMP/zig-linux-x86_64-0.14.0" >> "$GITHUB_PATH" | ||
| shell: bash | ||
|
|
||
| - name: Build bubblewrap helper | ||
| run: | | ||
| bun packages/opencode/script/kilocode/bubblewrap.ts --arch x64 --output "$RUNNER_TEMP/bwrap" | ||
| echo "KILO_BWRAP_PATH=$RUNNER_TEMP/bwrap" >> "$GITHUB_ENV" | ||
| shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| export namespace TestShard { | ||
| export type Info = { | ||
| index: number | ||
| total: number | ||
| } | ||
|
|
||
| export function parse(input?: string) { | ||
| if (!input) return { ok: true as const, value: undefined } | ||
| const match = input.match(/^(\d+)\/(\d+)$/) | ||
| if (!match) return { ok: false as const, error: `Invalid test shard "${input}"; expected N/M` } | ||
|
|
||
| const value = { index: Number(match[1]), total: Number(match[2]) } | ||
| if ( | ||
| !Number.isSafeInteger(value.index) || | ||
| !Number.isSafeInteger(value.total) || | ||
| value.total < 1 || | ||
| value.total > 1_000 || | ||
| value.index < 1 || | ||
| value.index > value.total | ||
| ) { | ||
| return { ok: false as const, error: `Invalid test shard "${input}"; expected 1 <= N <= M <= 1000` } | ||
| } | ||
| return { ok: true as const, value } | ||
| } | ||
|
|
||
| export function order(files: readonly string[], weight: (file: string) => number) { | ||
| return files.slice().sort((a, b) => weight(b) - weight(a) || a.localeCompare(b)) | ||
| } | ||
|
|
||
| export function split(files: readonly string[], weight: (file: string) => number, total: number) { | ||
| const groups = Array.from({ length: total }, () => ({ files: [] as string[], weight: 0 })) | ||
| for (const file of order(files, weight)) { | ||
| const group = groups.reduce((best, item) => { | ||
| if (item.weight < best.weight) return item | ||
| if (item.weight === best.weight && item.files.length < best.files.length) return item | ||
| return best | ||
| }) | ||
| group.files.push(file) | ||
| group.weight += weight(file) | ||
| } | ||
| return groups.map((group) => group.files) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.