Skip to content

ci: shard Ruby tests across parallel jobs - #684

Merged
jbeckwith-oai merged 1 commit into
mainfrom
codex/ci-performance
Sep 8, 2026
Merged

ci: shard Ruby tests across parallel jobs#684
jbeckwith-oai merged 1 commit into
mainfrom
codex/ci-performance

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

The Ruby test matrix determines CI completion: PR #683 spent 6m47s–8m47s in each Run tests step while all other CI jobs finished within 53 seconds. Split the primary test suite into three disjoint groups of whole files on each of Ruby 3.3, 3.4, and 4.0. Every existing test still runs on every version, and existing serial scheduling—including large-payload cases—is preserved.

TEST_SHARD=1/3 ./scripts/test reproduces a group locally; omitting TEST_SHARD still runs the complete primary suite. Invalid configurations and empty groups fail visibly. The existing ci-required gate requires all nine matrix jobs to succeed. Permissions, action pins, Bedrock testing, and the 15-minute timeout from #683 are unchanged.

Validation

  • Local Ruby 4.0.6 baseline: 1,872 tests in 254s; zero failures/errors, one platform skip.
  • Three local shards: 555 / 671 / 650 tests in 22s / 93s / 143s; zero failures/errors and the same platform skip. Combined count is 1,876, including four new sharding tests.
  • Regression coverage verifies exhaustive/disjoint coverage against the repository inventory, all supported Rubies, discovery-order independence, invalid configuration, and empty-selection failure.
  • Full lint/formatting, Sorbet, and RBS validation passed; custom-code budget passed at 3,451 / 4,000 lines.
  • Independent adversarial review and CI security review completed before pushing. Hosted CI timings will verify the actual wall-time benefit; local measurements are diagnostic and runner performance varies.

Tradeoff: six additional runner jobs add setup overhead and consume more concurrency. This reduces feedback latency while preserving coverage; it does not eliminate the repeated whole-tree typechecking and RBI-merge work identified during profiling.

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner September 8, 2026 16:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T16:04:28.417330Z 50de955 PR opened
🔒 Security Review Completed 2026-09-08T16:05:20.094791Z 50de955 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openai-sdks

openai-sdks Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

236/236 SDK tests passed in 9.975s for Ruby SDK PR #684.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 185ms
tests/chat-completions-create.test.ts ✅ Passed 271ms
tests/chat-completions-stream.test.ts ✅ Passed 168ms
tests/files-content-binary.test.ts ✅ Passed 162ms
tests/files-create-multipart.test.ts ✅ Passed 170ms
tests/files-list-pagination.test.ts ✅ Passed 205ms
tests/initialize-config.test.ts ✅ Passed 173ms
tests/instance-isolation.test.ts ✅ Passed 145ms
tests/models-list.test.ts ✅ Passed 190ms
tests/responses-background-lifecycle.test.ts ✅ Passed 231ms
tests/responses-body-method-errors.test.ts ✅ Passed 465ms
tests/responses-cancel-timeout.test.ts ✅ Passed 293ms
tests/responses-cancel.test.ts ✅ Passed 227ms
tests/responses-compact-retries.test.ts ✅ Passed 291ms
tests/responses-compact.test.ts ✅ Passed 233ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 149ms
tests/responses-create-advanced.test.ts ✅ Passed 181ms
tests/responses-create-disconnect.test.ts ✅ Passed 168ms
tests/responses-create-errors.test.ts ✅ Passed 359ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 202ms
tests/responses-create-retries.test.ts ✅ Passed 182ms
tests/responses-create-stream-failures.test.ts ✅ Passed 161ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 238ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.221s
tests/responses-create-stream.test.ts ✅ Passed 148ms
tests/responses-create-terminal-states.test.ts ✅ Passed 266ms
tests/responses-create-timeout.test.ts ✅ Passed 291ms
tests/responses-create.test.ts ✅ Passed 284ms
tests/responses-delete.test.ts ✅ Passed 190ms
tests/responses-input-items-errors.test.ts ✅ Passed 195ms
tests/responses-input-items-list.test.ts ✅ Passed 192ms
tests/responses-input-items-options.test.ts ✅ Passed 105ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 291ms
tests/responses-input-tokens-count.test.ts ✅ Passed 301ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.454s
tests/responses-not-found-errors.test.ts ✅ Passed 334ms
tests/responses-parse.test.ts ✅ Passed 198ms
tests/responses-retrieve-retries.test.ts ✅ Passed 302ms
tests/responses-retrieve.test.ts ✅ Passed 260ms
tests/responses-stored-method-errors.test.ts ✅ Passed 777ms
tests/retry-behavior.test.ts ✅ Passed 3.378s
tests/sdk-error-shape.test.ts ✅ Passed 427ms

View OkTest run #34248509398

SDK merge (e095cf5b4e12) · head (50de9558463d) · base (c368a06db374) · OkTest (08ec4299e769)

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

50 mixed files remain; 0 existing customizations changed.

Compared c368a06db37450de9558463d. Generated baselines verified.

50 existing customizations unchanged
  • lib/openai.rb
  • lib/openai/client.rb
  • lib/openai/models/audio/transcription_create_response.rb
  • lib/openai/models/chat/chat_completion_message.rb
  • lib/openai/models/chat/chat_completion_message_function_tool_call.rb
  • lib/openai/models/chat/completion_create_params.rb
  • lib/openai/models/response_format_json_schema.rb
  • lib/openai/models/responses/function_tool.rb
  • lib/openai/models/responses/response.rb
  • lib/openai/models/responses/response_create_params.rb
  • lib/openai/models/responses/response_format_text_config.rb
  • lib/openai/models/responses/response_format_text_json_schema_config.rb
  • lib/openai/models/responses/response_function_tool_call.rb
  • lib/openai/models/responses/response_function_web_search.rb
  • lib/openai/models/responses/response_output_text.rb
  • lib/openai/models/responses/tool.rb
  • lib/openai/resources/beta/threads.rb
  • lib/openai/resources/chat/completions.rb
  • lib/openai/resources/containers/files.rb
  • lib/openai/resources/files.rb
  • lib/openai/resources/responses.rb
  • lib/openai/resources/vector_stores/file_batches.rb
  • lib/openai/resources/vector_stores/files.rb
  • lib/openai/resources/webhooks.rb
  • rbi/openai/client.rbi
  • rbi/openai/models/chat/chat_completion_message.rbi
  • rbi/openai/models/chat/chat_completion_message_function_tool_call.rbi
  • rbi/openai/models/chat/completion_create_params.rbi
  • rbi/openai/models/response_format_json_schema.rbi
  • rbi/openai/models/responses/response.rbi
  • rbi/openai/models/responses/response_create_params.rbi
  • rbi/openai/models/responses/response_function_tool_call.rbi
  • rbi/openai/models/responses/response_function_web_search.rbi
  • rbi/openai/models/responses/response_output_text.rbi
  • rbi/openai/resources/chat/completions.rbi
  • rbi/openai/resources/files.rbi
  • rbi/openai/resources/responses.rbi
  • rbi/openai/resources/vector_stores/file_batches.rbi
  • rbi/openai/resources/vector_stores/files.rbi
  • scripts/castiron/README.md

10 more in the full report.

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 34248543568 --repo openai/openai-ruby \
  --name castiron-custom-code-34248543568-1 --dir /tmp/castiron-custom-code-34248543568-1
git apply --stat /tmp/castiron-custom-code-34248543568-1/custom-code.patch
cat /tmp/castiron-custom-code-34248543568-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin c368a06db374892273812f64c823f8d7b21871a2 50de9558463d2a8d34452725fd8b7cd520c18e49
python3 scripts/castiron/custom_code_report.py report \
  --base c368a06db374892273812f64c823f8d7b21871a2 \
  --head 50de9558463d2a8d34452725fd8b7cd520c18e49 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-50de9558463d
cat /tmp/castiron-custom-code-50de9558463d/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

Hosted CI is green: https://github.com/openai/openai-ruby/actions/runs/34248506645

  • Elapsed time: 4m13s, versus 6m53s on the immediately preceding main run (39% faster) and 9m15s on ci: allow 15 minutes for Ruby test jobs #683's PR run (54% faster).
  • All three Ruby versions ran 1,876 tests each across their shards, with zero failures, errors, or skips.
  • All 24 executable PR checks passed; the two event-inapplicable jobs were skipped.
  • Summed job duration: 25m37s, versus 19m15s on preceding main and 25m43s on ci: allow 15 minutes for Ruby test jobs #683. This improves feedback latency through concurrency; it is not a claim of reduced aggregate compute.

Shard durations:

Ruby Shard 1 Shard 2 Shard 3
3.3 1m19s 2m38s 3m48s
3.4 1m08s 3m03s 4m01s
4.0 1m14s 2m59s 2m57s

These are single-run comparisons with substantial runner variation. The remaining opportunities are better shard balance and reducing repeated whole-tree typechecking/merge work while preserving compatibility checks.

@markstuart-oai markstuart-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed all five changed files and the existing test launcher, Rake selection, serial scheduling, and required CI gate at 50de955. No actionable correctness or structural findings. The small pure selector keeps partitioning in test infrastructure without complicating scheduling; the nine matrix jobs remain covered by ci-required.

Independent Ruby 4.0.6 checks confirmed the actual Rake inventory partitions 251 primary files into 84/84/83 with unchanged default order, no duplication, and no Bedrock leakage. The four new tests passed through ./scripts/test; additional entrypoint probes passed for unset/1-of-1 sharding, invalid and empty selections, and explicit Bedrock rejection. The related launcher suite had one local readiness-timeout assertion failure; I did not complete a full local suite or run other Ruby versions.

Read-only Actions metadata confirms 4m13s elapsed and 25m37s summed job time versus 6m53s/19m15s on preceding main and 9m15s/25m43s on #683. These single-run results support faster feedback through concurrency, not reduced aggregate compute; setup duplication and existing whole-tree typecheck/RBI work remain.

@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Sep 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 8, 2026
@jbeckwith-oai
jbeckwith-oai added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit 31bbd60 Sep 8, 2026
26 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/ci-performance branch September 8, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants