Repository navigation
refactor: move the session conformance helpers next to what they test - #5233
Merged
Merged
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ananthsub
marked this pull request as ready for review
October 28, 2026 22:42
35 of 41 tasks
Contributor
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 28, 2026 23:10
58c4106 to
927e9a4
Compare
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 29, 2026 00:55
927e9a4 to
b41c74a
Compare
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 29, 2026 15:51
c95acde to
01324ae
Compare
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 29, 2026 16:27
01324ae to
65da242
Compare
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 29, 2026 16:45
65da242 to
396edff
Compare
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 29, 2026 17:01
396edff to
72ca5e5
Compare
ananthsub
force-pushed
the
ananthsub/layout-testing
branch
from
October 29, 2026 18:25
72ca5e5 to
34c8c5a
Compare
testing/session_conformance.py moves to server_runtime/testing/ with the package's __init__.py, and testing/agent_session_conformance.py to agents/testing/, which gets a copy of that __init__.py. Record nemo_gym.testing as moved to server_runtime/testing, with a longer entry for the agent helper, rewrite in-repo references with scripts/migrate_imports.py, drop the contract's testing layer, and redirect the old library reference pages in fern/docs.yml. Regenerate the public API of each layout package that exists here from what non-test code outside nemo_gym imports, and point code outside nemo_gym, tests included, at nemo_gym.<package>. Signed-off-by: Ananth Subramaniam <[email protected]>
This branch was previously deployed
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 and why
Dissolves the top-level
nemo_gym/testing/package. It held two conformance helpers that server and agent tests use to check a session's contract. Each now sits next to what it tests, which its imports already allowed:nemo_gym/testing/session_conformance.pynemo_gym/server_runtime/testing/session_conformance.pycore,server_runtimenemo_gym/testing/agent_session_conformance.pynemo_gym/agents/testing/agent_session_conformance.pyagentsharness_capabilities, the proposal's othertesting/module, moved torollouts/in #5231: it imports the rollout health code and nothing in the library imports it.Where this PR sits
The stack lands bottom-up; each PR's base is the branch of the PR before it, so each diff shows only that PR's change.
How to review
One commit. Its changes:
testing/subpackage gets the old package's__init__.pydocstring ("Import them from tests, not from server code").nemo_gym.testingis recorded as moved toserver_runtime/testingwith a longer entry for the agent helper, references are rewritten byscripts/migrate_imports.py, the contract loses its testing layer, andfern/docs.ymlredirects the old library reference pages.Public API
Every layout package that exists after this PR has a lazy public API in its
__init__.py: the names code outsidenemo_gym/imports from it (servers and their tests, benchmarks, scripts, and code samples in docs and skills), plus every name it already exported, each served from the submodule that defines it on first use. Code outsidenemo_gym/and its tests (servers and their tests, benchmarks, scripts, and docs) imports those names fromnemo_gym.<package>, so later moves inside a package leave it alone. Code insidenemo_gym/, and the library's tests undertests/, import from the module that defines each name, so the import-linter contract sees every dependency and a test reads what it patches. A patch target names the module the code under test looks the name up in.AGENTS.mdstates the rule.Validation
pytest -n 16 tests/unit_tests, also with-W errorfor the old paths. The only failures are environment-specific and unrelated to the move, as in the other PRs.lint-imports;pre-commit runon the changed files.Rollout evidence: N/A. The helpers move unchanged.
Compatibility
nemo_gym.testing,nemo_gym.testing.session_conformance, andnemo_gym.testing.agent_session_conformancework until 0.10.0, with one warning each.python scripts/migrate_imports.py <paths>.Issue
Part of #5166.