tests: discuss removing dotenv environment mutation during TTS collection
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Read tests/test_tts.py, especially the module level load_dotenv(override=True) call and the collection time PLUGIN filtering. First reproduce the overwrite in a subprocess using a temporary .env and dummy values, then determine how provider selection and credentials should be prepared explicitly for TTS tests. Done means collect only preserves preexisting environment values while intentional TTS configuration still works.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
While auditing test import-time side effects after #8134, I noticed that tests/test_tts.py calls load_dotenv(override=True) at module scope.
At main commit 2a1c02d17cb90244dc27a8161ff4825707430665, this is at line 56:
https://github.com/livekit/agents/blob/2a1c02d17cb90244dc27a8161ff4825707430665/tests/test_tts.py#L56
Importing the module during collection can therefore replace pre-existing process environment values with values from a discovered .env, even when no test executes. Later in the same module, the PLUGIN environment variable controls parameter filtering, so preserving intentional collection-time configuration needs care.
This module already has the tts category marker. Category filtering protects --unit runs; this report concerns collection when the TTS module is selected or pytest runs without a category filter. I am not claiming the current unit gate imports it or that this causes a model download.
Verification
I parsed the test module, extracted its module-level load_dotenv(override=True) expression, and executed that expression using the real python-dotenv loader with an explicit temporary .env path. With a dummy variable initially set to from-shell and the temporary file setting it to from-dotenv, the expression overwrote the original value. No real credentials were used or inspected.
This is an isolated verification of the statement's overwrite behavior, not a full pytest collection reproduction. A regression test should exercise collection in a subprocess with a temporary .env and dummy values.
Proposed scope for discussion
Would you welcome a small follow-up that removes implicit environment mutation from importing this module and makes dotenv preparation explicit for TTS test execution?
The implementation would preserve intentional provider selection and credential setup, and verify that collect-only does not overwrite dummy environment values. Since PLUGIN is read during collection, simply moving everything into an autouse fixture would be insufficient; I would agree on the intended configuration path before implementing it.
No production behavior, changelogs, package manifests, or version files would change. I have not started an implementation and would appreciate guidance on the preferred scope.
- Ngôn ngữ chính
- Python
- Star
- 14.6k
- Fork
- 3.9k
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 228
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của livekit/agents
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Assistant markup is stripped from chat history when expressive mode is offCó thể đã có người làm @ShivamSharma43 đã nhận 21 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
livekit/agents#7647 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsCó thể làm lại được @AbarnaaSree đã nhận 60 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
livekit/agents#7022 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 32/100
Maintainer thường phản hồi trong vòng 1 ngày
-
OpenAI realtime: a long chat context sync or reconnect replay is sent in one event loop turnCó thể đã có người làm @zek đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của livekit/agents
Issue tương tự
-
area/profiles comp/cli P3 type/feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NousResearch/hermes-agent#146372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
GeoSeries scale and skew tests fail with pytest 9.2.0Có thể đã có người làm @jiayuasu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
admission-deferred priority: medium status: ready work-class: scoped
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
melodic-software/claude-code-plugins#10887 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày