Skip to content

test(warmup): stop the json contract test from downloading models - #703

Merged
KnockOutEZ merged 2 commits into
mainfrom
fix/warmup-json-contract-no-model-download
Nov 23, 2026
Merged

KnockOutEZ merged 2 commits into
mainfrom
fix/warmup-json-contract-no-model-download

Conversation

@KnockOutEZ

@KnockOutEZ KnockOutEZ commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

warmup-setup-json-contract.test.ts runs runWarmup(['--all', '--json']) without the reranker and embedding mocks that warmup.test.ts has. So the unit test loads the real models and downloads them from the network into /tmp/test-wigolo-warmup when they are not cached. On CI that is every run, and it is the 20s timeout seen on the windows unit job (PR runs on 10-31 and 11-10, "dtype not specified for model" in the test's stderr).

This PR adds the same two mocks as warmup.test.ts. The assertions are unchanged.

Tested with the cache dir removed: on main the file takes 19s and leaves 162MB of models in /tmp/test-wigolo-warmup. On this branch it takes 2s and writes nothing there. All 3 tests pass.

The earlier red ubuntu x64 jobs failed at npm ci on the onnxruntime CUDA download (404). That is fixed on main by #705, and this branch now includes it.

Summary by CodeRabbit

  • Tests
    • Updated warmup CLI tests to use mocked model providers, preventing network downloads during test runs.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The warmup CLI contract test now mocks the reranker and FastEmbed providers. The mocks provide fixed model identifiers and minimal results, so the test does not download models from the network.

Changes: Warmup CLI contract test

Layer / File(s) Summary
Mock provider behavior
tests/unit/cli/warmup-setup-json-contract.test.ts
The test mocks the reranker and FastEmbed providers with fixed model identifiers and warmup, rerank, and embed results.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Possibly related PRs

  • KnockOutEZ/wigolo#675: Reports a timeout in the same test. The cause may be related to loading real models, but the available evidence does not confirm this.
Merge Risk: Minimal · up to 47a0a

This change only stops a warmup contract test from downloading models, making it faster and offline-safe. It does not touch production behavior, and there is no remaining merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the warmup JSON contract test no longer downloads models. The raw summary confirms the test now mocks the reranker and FastEmbed providers, which prevents network mod…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title states the main change: the warmup JSON contract test no longer downloads models. The raw summary confirms the test now mocks the reranker and FastEmbed providers, which prevents network model downloads in the --all test. The title uses the conventional test(scope) prefix and is specific enough for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab7ffee9-9503-428c-9ef8-dd0eb5255bd0
Commits

Reviewing files that changed from the base of the PR and between 5698c88 and 47a0a86.

Files selected for processing: 1

  • tests/unit/cli/warmup-setup-json-contract.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@KnockOutEZ
KnockOutEZ merged commit 4f19a89 into main Nov 23, 2026
17 checks passed
@KnockOutEZ
KnockOutEZ deleted the fix/warmup-json-contract-no-model-download branch November 23, 2026 11:57
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.

1 participant