Skip to content

Python: Remove the stale hosted toolbox endpoint sample test - #9762

Draft
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
microsoft:mainfrom
1aifanatic:contrib/python-stale-toolbox-endpoint-test
Draft

Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
microsoft:mainfrom
1aifanatic:contrib/python-stale-toolbox-endpoint-test

Conversation

@1aifanatic

Copy link
Copy Markdown
Contributor

Motivation & Context

python/tests/samples/hosting/test_toolbox_endpoint.py loads responses/04_foundry_toolbox/main.py and responses/06_files/main.py at import time. #7405 renamed those folders to foundry_toolbox and files. The samples also no longer define resolve_toolbox_endpoint: they use FoundryToolbox, which resolves the endpoint in agent_framework_foundry_hosting._toolbox._resolve_toolbox_endpoint. The module therefore fails at collection:

FileNotFoundError: [Errno 2] No such file or directory: '.../responses/04_foundry_toolbox/main.py'

That stops every pytest tests/samples ... run, including the CI sample steps. #9761 describes this and three similarly stale getting_started modules.

Description & Review Guide

  • What are the major changes?
    • Delete tests/samples/hosting/test_toolbox_endpoint.py.
    • packages/foundry_hosting/tests/test_toolbox.py already covers four of its five cases against the real resolver: explicit endpoint, empty endpoint, built fallback, and missing inputs. The fifth case, several trailing slashes on FOUNDRY_PROJECT_ENDPOINT, is added by parametrizing test_resolve_endpoint_builds_from_project_and_name over no slash, one slash and three slashes.
  • What is the impact of these changes? Tests only.
  • What do you want reviewers to focus on? The getting_started modules in Python: tests/samples fails to collect because four test modules import samples that no longer exist #9761 need a decision about whether to repoint them or remove them, so this PR leaves them alone.

The foundry_hosting suite passes (917 passed, 28 skipped, 8 xpassed). pytest tests/samples --collect-only no longer reports the hosting module; the three getting_started errors remain, tracked in #9761.

Related Issue

Part of #9761

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Claude Code helped find the stale test, compare its cases with the package tests, make the change, and draft this description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

🤖 Generated with Claude Code

tests/samples/hosting/test_toolbox_endpoint.py loads 04_foundry_toolbox
and 06_files, which microsoft#7405 renamed, and the samples no longer define
resolve_toolbox_endpoint, so pytest tests/samples stops at collection.
The resolver now lives in agent_framework_foundry_hosting and is covered
by its own tests; port the remaining trailing-slash case there.

Part of microsoft#9761.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 12:56
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 27, 2026

Copilot AI 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.

🟢 Approval recommended

The narrow test-only changes remove obsolete imports and preserve the deleted test scenarios without changing production behavior.

No open issues 🎉

What changed in this PR

This test-only PR removes an obsolete hosting sample test that blocks collection and preserves its coverage in the Foundry hosting package tests. It addresses the hosting portion of #9761; the three stale getting_started modules remain out of scope.

Changes:

  • Delete tests that import renamed samples and reference a resolver those samples no longer define.
  • Parameterize the package resolver test to cover project endpoints with zero, one, or three trailing slashes.
File Description
python/​tests/​samples/​hosting/​test_toolbox_endpoint.py Remove the obsolete sample test module causing a collection error.
python/​packages/​foundry_hosting/​tests/​test_toolbox.py Preserve trailing-slash coverage against the package resolver.

Review effort: Balanced

This branch was previously deployed

1 inactive deployment
github-app-auth — 958de1eb Deployed Oct 27, 2026 by 1aifanatic via team_check #7696
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants