fix(test): register baidu_obs mock as pytest plugin#35618
Merged
crazywoola merged 1 commit intolanggenius:mainfrom Apr 28, 2026
Merged
fix(test): register baidu_obs mock as pytest plugin#35618crazywoola merged 1 commit intolanggenius:mainfrom
crazywoola merged 1 commit intolanggenius:mainfrom
Conversation
6 tasks
`from tests.unit_tests.oss.__mock.baidu_obs import setup_baidu_obs_mock` imports the function but does not register it as a pytest fixture, so `TestBaiduObs.setup_method(self, setup_baidu_obs_mock)` raises `fixture 'setup_baidu_obs_mock' not found` whenever the unit-test job actually runs this file. Replace the unused import with `pytest_plugins = (...)`, matching the pattern already used by `test_aliyun_oss.py`, `test_tencent_cos.py`, and `test_volcengine_tos.py`. The bug slipped through CI on langgenius#34330 because the path filter on `Run API Tests / API Unit Tests` skips any PR that only touches `api/tests/unit_tests/oss/baidu_obs/`, so the fixture was never resolved in main's CI runs.
6561ed2 to
a54a053
Compare
crazywoola
approved these changes
Apr 28, 2026
fatelei
pushed a commit
that referenced
this pull request
Apr 29, 2026
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.
Fixes #35623
Summary
api/tests/unit_tests/oss/baidu_obs/test_baidu_obs.py(added in #34330) imports the mock fixture as a regular module-level symbol:That imports the function but does not register it as a pytest fixture, so any run that actually collects this file fails with
fixture 'setup_baidu_obs_mock' not foundand 6 ERROR entries (one per test inTestBaiduObs).This PR replaces the unused import with the standard
pytest_pluginsdeclaration, matchingtest_aliyun_oss.py,test_tencent_cos.pyandtest_volcengine_tos.py:Why this slipped through CI:
Run API Tests / API Unit Tests (3.12)is gated by a path filter. PR #34330 only touched files underapi/tests/unit_tests/oss/baidu_obs/, which the filter does not recognize as an "API change", so the unit-test job was skipped on that PR and on every subsequent main push. The first PRs that touch broaderapi/paths (e.g. #35515) hit the failure. Verified by inspecting the job conclusions on recent main runs:Run API Testsisskippedon every one of them.Verification:
Screenshots
ERROR ... fixture 'setup_baidu_obs_mock' not found(×6)7 passedChecklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods