refactor: split large test and source files into focused modules#5299
Open
skamenan7 wants to merge 4 commits intollamastack:mainfrom
Open
refactor: split large test and source files into focused modules#5299skamenan7 wants to merge 4 commits intollamastack:mainfrom
skamenan7 wants to merge 4 commits intollamastack:mainfrom
Conversation
Contributor
|
This pull request has merge conflicts that must be resolved before it can be merged. @skamenan7 please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork |
4baf184 to
dbba243
Compare
Contributor
Author
|
Hi @leseb , thanks for the PR# 5281 review and merge. this one follows that one for more changes. PTAL. |
8806bdf to
01c9ea8
Compare
leseb
reviewed
Mar 26, 2026
b229b9d to
2d415d6
Compare
9bd0f3a to
4de2882
Compare
5682761 to
bad3eed
Compare
Split 1438-line test_openai_mixin.py into: - openai_mixin_helpers.py: shared impl classes - conftest.py: shared fixtures (auto-discovered by pytest) - test_openai_mixin_models.py: model lifecycle tests (580L) - test_openai_mixin_provider_data.py: provider data and custom list tests (200L) - test_openai_mixin_inference.py: inference enforcement and stream options tests (520L) Removes test_openai_mixin.py from GRANDFATHERED_FILES in check_file_size.py. Signed-off-by: skamenan7 <skamenan@redhat.com>
… group Split 3226-line test_openai_responses.py into: - conftest.py: shared fixtures (116L, auto-discovered) - test_openai_responses_helpers.py: fake_stream generator (47L) - test_openai_responses_core.py: core creation, instructions, store logic (857L) - test_openai_responses_agent.py: failed streams, agent loop incomplete (500L) - test_openai_responses_tools.py: tool calls, MCP, file search (670L) - test_openai_responses_prompts.py: prompt template variants (579L) - test_openai_responses_params.py: param passthrough, service_tier, stream_options (856L) Removes test_openai_responses.py from GRANDFATHERED_FILES in check_file_size.py. 103 tests pass across all new files. Signed-off-by: skamenan7 <skamenan@redhat.com>
Split 3319-line ifeval_utils.py into: - ifeval_word_list.py: WORD_LIST data literal only (1552L, grandfathered as pure data) - ifeval_support.py: LANGUAGE_CODES, regex constants, utility functions, arg constants (296L) - ifeval_checkers_core.py: Instruction base + 15 checker classes (828L) - ifeval_checkers_format.py: 15 checker classes (703L) - ifeval_utils.py: thin entry point with INSTRUCTION_DICT/LIST registry (96L) Updates pyproject.toml per-file-ignores to point RUF001 suppression at the new files containing Unicode characters instead of the now-thin ifeval_utils.py. External import path preserved: ifeval_scoring_fn.py unchanged. Also removes stale plugin import of deleted test_openai_responses from root conftest.py. Signed-off-by: skamenan7 <skamenan@redhat.com>
…ort.py Upstream PR llamastack#5267 added a docstring to get_langid() in ifeval_utils.py. Since that function now lives in ifeval_support.py after the split, carry the docstring over to the correct location. Signed-off-by: skamenan7 <skamenan@redhat.com>
bad3eed to
da84966
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Splits 3 Python files that exceeded 1000 lines into smaller, focused modules. Pure refactoring with no behavior changes. All public names remain importable from the same paths.
tests/unit/providers/utils/inference/test_openai_mixin.pytests/unit/providers/responses/builtin/test_openai_responses.pysrc/llama_stack/providers/inline/scoring/basic/utils/ifeval_utils.pytest_openai_mixin.py— split by test concern:openai_mixin_helpers.py— shared impl classes (180L)conftest.py— shared fixtures, auto-discovered by pytest (16L)test_openai_mixin_models.py— model listing, registration, availability (580L)test_openai_mixin_provider_data.py— provider data API key, custom model lists (200L)test_openai_mixin_inference.py— inference enforcement, stream options, param passthrough (520L)test_openai_responses.py— split by feature group:conftest.py— 11 shared fixtures (116L)test_openai_responses_helpers.py— shared async generator (47L)test_openai_responses_core.py— core response creation, instructions, store logic (857L)test_openai_responses_agent.py— failed streams, agent loop, incomplete details (500L)test_openai_responses_tools.py— tool calls, MCP, file search, strict field (670L)test_openai_responses_prompts.py— prompt template variants (579L)test_openai_responses_params.py— param passthrough, service tier, stream options (856L)ifeval_utils.py— split by responsibility:ifeval_word_list.py—WORD_LISTdata literal only, grandfathered as pure data (1552L)ifeval_support.py— language constants, regex patterns, utility functions (296L)ifeval_checkers_core.py—Instructionbase class + 15 checker classes (828L)ifeval_checkers_format.py— 15 checker classes (703L)ifeval_utils.py— thin entry point: re-exportsINSTRUCTION_DICTandINSTRUCTION_LIST(96L)The external import in
ifeval_scoring_fn.pyis unchanged. Shared fixtures previously loaded via a rootconftest.pyplugin import are now in a directory-levelconftest.pyand auto-discovered by pytest.Test Plan