Skip to content

ci: split Windows opencode unit tests#146

Merged
Astro-Han merged 2 commits into
devfrom
codex/ci-windows-opencode-shards
Apr 22, 2026
Merged

ci: split Windows opencode unit tests#146
Astro-Han merged 2 commits into
devfrom
codex/ci-windows-opencode-shards

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Summary

Split the advisory Windows opencode unit signal into three stable directory shards: opencode-session, opencode-config-project, and opencode-server-tools.

Why

The current unit-windows-opencode job is the long pole for advisory Windows CI. Recent successful runs showed the opencode Windows unit step commonly around 9 to 10 minutes and the whole check around 13 to 14 minutes. Sharding only the opencode Windows signal should reduce PR wall time while keeping Windows checks advisory.

Related Issue

No issue. This is a small CI wall-time optimization with a narrow workflow-only scope.

How To Verify

TDD RED: after adding the coverage contract, temporarily omitted test/auth from the server-tools shard and confirmed the test failed with missing test/auth/auth.test.ts.

bun --cwd packages/opencode test test/github/ci-workflow.test.ts -t "covers each opencode test file exactly once"
bun --cwd packages/opencode test test/github
git diff --check

Fresh-eyes review: first review found the missing coverage contract, fixed; second review returned no findings.

Screenshots or Recordings

Not applicable, no visible UI changes.

Checklist

  • I linked the related issue, or stated why there is no issue
  • This PR has type, scope, and priority labels, or I requested maintainer labeling
  • I listed the relevant verification steps, including tests when behavior changed
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for desktop, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, or generated/local file changes when relevant
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

Release Notes

  • Chores
    • Optimized Windows continuous integration infrastructure with improved test execution efficiency through better organization and parallel processing capabilities.
    • Enhanced test workflow configuration with refined resource allocation and improved reporting to provide clearer visibility into test suite performance.
    • Improved test infrastructure to support faster execution and more granular tracking across different test categories.

@Astro-Han Astro-Han added ci Continuous integration / GitHub Actions windows Windows-specific P2 Medium priority labels Apr 22, 2026
@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 17 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 17 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5cdb41e2-ef98-431e-9d90-6a6df9dc363b

📥 Commits

Reviewing files that changed from the base of the PR and between 4f2c928 and f19b206.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • packages/opencode/test/github/ci-workflow.test.ts
📝 Walkthrough

Walkthrough

This PR restructures the Windows unit test job matrix by splitting the original opencode package entry into three shard-scoped test variants (opencode-session, opencode-config-project, opencode-server-tools). Each shard runs independent test paths with dedicated JUnit output and conditional Turbo caching, alongside updated test assertions and filesystem-based test file discovery.

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/ci.yml
Replaced single opencode matrix entry with three shard-scoped variants; added per-matrix uses_turbo and opencode_shard flags; made Turbo cache step conditional on matrix.uses_turbo; added report directory creation step before test execution.
CI Workflow Test Suite
packages/opencode/test/github/ci-workflow.test.ts
Added filesystem-based test file discovery helpers; defined Windows-specific unit package entries with shard configurations; updated Windows matrix assertions to verify shard entries, conditional cache logic, and report paths; added coverage test ensuring all discovered opencode test files are included exactly once across shard commands; updated blocking aggregate "needs" assertions to exclude new shard job variants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Astro-Han/pawwork#139: Modifies Windows unit job matrix structure and associated workflow tests, splitting original Windows jobs into multiple variants.
  • Astro-Han/pawwork#125: Updates CI workflow and opencode CI tests to split package-scoped unit jobs and adjust Windows/opencode job matrix behavior.

Poem

🐰 Three shards hop where one did test,
Windows workflows now split their best,
Turbo caches dance when needed so,
Discovery finds each test below,
Clean reports in files aligned! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ci: split Windows opencode unit tests' accurately and concisely describes the main change—splitting the Windows opencode unit tests into shards.
Description check ✅ Passed The description covers all required template sections: Summary, Why, Related Issue, How To Verify, Screenshots/Recordings, and a completed Checklist with all items marked complete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-windows-opencode-shards

Comment @coderabbitai help to get the list of available commands and usage tips.

@Astro-Han Astro-Han force-pushed the codex/ci-windows-opencode-shards branch from 4fa12b2 to b650ef3 Compare April 22, 2026 13:49

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CI workflow tests to support sharding of Windows unit tests for the opencode package. It introduces three specific shards—opencode-session, opencode-config-project, and opencode-server-tools—and adds a comprehensive test to ensure all opencode test files are covered exactly once across these shards without duplicates or omissions. I have no feedback to provide.

@Astro-Han

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
@Astro-Han Astro-Han force-pushed the codex/ci-windows-opencode-shards branch from b650ef3 to 38d46a3 Compare April 22, 2026 14:19
Comment thread .github/workflows/ci.yml
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread .github/workflows/ci.yml
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
@Astro-Han Astro-Han force-pushed the codex/ci-windows-opencode-shards branch from 38d46a3 to 39dcaae Compare April 22, 2026 14:33
Comment thread .github/workflows/ci.yml
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
@Astro-Han Astro-Han force-pushed the codex/ci-windows-opencode-shards branch from 39dcaae to 4f2c928 Compare April 22, 2026 14:54

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits only, no blockers. The shard plan and coverage contract are sound and the TDD-RED evidence for the missing test/auth entry is convincing. Leaving a handful of rough edges below, mostly P2/P3.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread packages/opencode/test/github/ci-workflow.test.ts Outdated
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts Outdated
Comment thread packages/opencode/test/github/ci-workflow.test.ts Outdated
Comment thread packages/opencode/test/github/ci-workflow.test.ts
Comment thread packages/opencode/test/github/ci-workflow.test.ts
@Astro-Han Astro-Han force-pushed the codex/ci-windows-opencode-shards branch from 4f2c928 to 4dd200a Compare April 22, 2026 16:08
@Astro-Han Astro-Han force-pushed the codex/ci-windows-opencode-shards branch from 4dd200a to f19b206 Compare April 22, 2026 16:12
@Astro-Han Astro-Han merged commit a599265 into dev Apr 22, 2026
23 checks passed
@Astro-Han Astro-Han deleted the codex/ci-windows-opencode-shards branch April 22, 2026 16:37
@coderabbitai coderabbitai Bot mentioned this pull request May 3, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration / GitHub Actions P2 Medium priority windows Windows-specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant