Skip to content

test(llm): move call tests to module mirrors - #2265

Open
Pouyanpi wants to merge 1 commit into
developfrom
pouyanpi/refactor-llm-call-tests
Open

test(llm): move call tests to module mirrors#2265
Pouyanpi wants to merge 1 commit into
developfrom
pouyanpi/refactor-llm-call-tests

Conversation

@Pouyanpi

@Pouyanpi Pouyanpi commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Moves llm.call tests into module-aligned files; no runtime changes.

Related: follow-up to #2241.

AI Assistance

  • AI tools were used; a human reviewed and can explain every change (tool: Codex).

Stack Position

Part 1 of 2.

Stack Context

Moves llm_call tests first so the NGUARD-880 fix is reviewed as a small behavioral diff.

Please review each PR against its parent branch, not directly against the root base branch, except for part 1.

Order PR Branch Base
1 #2265 pouyanpi/refactor-llm-call-tests develop
2 #2266 pouyanpi/fix-nguard-880-stop-and-messages pouyanpi/refactor-llm-call-tests

Validation

593 passed, 25 skipped
pre-commit passed

Summary by CodeRabbit

  • Tests
    • Added integration coverage for LangChain provider detection, including wrapped, nested, unknown, and multiple-inheritance models.
    • Added tests for forwarding stop tokens and parameters, excluding empty values.
    • Added exception-handling tests that verify model and provider details are included.
    • Simplified existing reasoning tests without changing their behavior.

Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
@github-actions github-actions Bot added status: needs triage New issues that have not yet been reviewed or categorized. size: M labels Aug 7, 2026
@Pouyanpi
Pouyanpi marked this pull request as ready for review August 7, 2026 15:19
@Pouyanpi Pouyanpi added status: triaged Triaged by a maintainer; eligible for automated review (CodeRabbit/Greptile). and removed status: needs triage New issues that have not yet been reviewed or categorized. labels Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 937c1f88-d228-4ad4-9f3f-5cad3e82a23a

📥 Commits

Reviewing files that changed from the base of the PR and between f5900d1 and 47e0793.

📒 Files selected for processing (3)
  • tests/integrations/langchain/test_langchain_llm_adapter.py
  • tests/llm/test_call.py
  • tests/llm/test_call_reasoning.py
💤 Files with no reviewable changes (1)
  • tests/llm/test_call.py

📝 Walkthrough

Walkthrough

The change consolidates LangChain adapter integration tests, removes duplicated adapter coverage from test_call.py, and centralizes the llm_call import in reasoning tests.

Changes

LLM adapter test coverage

Layer / File(s) Summary
Add LangChain adapter integration coverage
tests/integrations/langchain/test_langchain_llm_adapter.py
Adds provider inference tests for known, unknown, wrapped, inherited, and nested LLM classes. Adds tests for parameter forwarding, stop-token binding, and enriched exceptions.
Remove duplicated adapter tests
tests/llm/test_call.py
Removes adapter imports, provider fixtures, provider inference tests, and adapter-specific llm_call tests.
Centralize reasoning test imports
tests/llm/test_call_reasoning.py
Moves the llm_call import to module scope and removes repeated local imports.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • NVIDIA-NeMo/Guardrails#2241: Both changes modify llm_call tests; this change relocates adapter coverage while #2241 refactors implementation and import paths.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: moving llm.call tests into module-aligned files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Test Results For Major Changes ✅ Passed The diff changes only test files and primarily moves tests; the PR description documents validation with 593 passed and 25 skipped.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pouyanpi/refactor-llm-call-tests

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

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Moves LLM-call and reasoning tests into module-aligned test files without changing runtime code.

  • Relocates provider inference and LangChain adapter call tests into the LangChain integration suite.
  • Moves core call and reasoning tests under tests/llm.
  • Updates moved tests to import llm_call directly from its canonical module.

Confidence Score: 5/5

The PR appears safe to merge; the changes only reorganize tests while preserving collection and tested behavior.

The new test locations remain covered by pytest discovery, no automation references the removed paths, and the updated import resolves to the same canonical function.

Important Files Changed

Filename Overview
tests/integrations/langchain/test_langchain_llm_adapter.py Adds relocated provider-inference and adapter-specific LLM-call tests with no behavioral regression identified.
tests/llm/test_call.py Relocates core call bookkeeping tests and removes LangChain-specific cases now housed in the integration suite.
tests/llm/test_call_reasoning.py Relocates reasoning-call tests and switches them to the canonical nemoguardrails.llm.call import.

Reviews (1): Last reviewed commit: "test(llm): move call tests to module mir..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M status: triaged Triaged by a maintainer; eligible for automated review (CodeRabbit/Greptile).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant