Make the test suite deterministic on Windows and proxied environments

Abierto
#181 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python

Línea de trabajo

Empieza por tests/test_transform.py:424 y los casos de proxy en tests/test_client.py:996 y tests/test_client.py:1936; después, ejecuta el comando de pytest documentado en Windows. Comprueba en pyproject.toml los sistemas operativos anunciados y la configuración de CI del repositorio. Se considera terminado cuando la suite principal pasa sin configuraciones de proxy del host ni diferencias en los finales de línea, y se ha añadido cobertura para Windows si la configuración de CI lo permite.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

The unit suite is not portable to a supported Windows checkout. On Windows with normal Git CRLF conversion and common proxy environment variables, four otherwise-local tests fail.

Reproduction

On Windows/Python 3.12 after installing the dev dependencies:

python -m pytest -q -n 0 -k "not aiohttp"

Observed failures:

  1. tests/test_transform.py:424 (sync and async): tests/sample_file.txt is checked out with CRLF, producing SGVsbG8sIHdvcmxkIQ0K; the assertion hard-codes LF bytes (SGVsbG8sIHdvcmxkIQo=).
  2. tests/test_client.py:996 and tests/test_client.py:1936: the proxy tests expect one mount after setting HTTP_PROXY, but inherited NO_PROXY/proxy environment state can cause httpx to produce zero matching mounts.

Result from this audit: 4 failed, 1072 passed, 2 skipped after excluding the separately parameterized aiohttp cases. The remaining suite passes.

Expected behavior

Tests should pass on every OS advertised in pyproject.toml (Operating System :: Microsoft :: Windows) and should isolate themselves from host proxy variables and line-ending conversion.

Suggested fixes:

  • Make sample_file.txt binary-stable via .gitattributes, or derive the expected base64 from the file bytes rather than a hard-coded newline convention.
  • Clear all relevant proxy/no-proxy environment variables in the proxy tests before setting the values under test.
  • Add a Windows CI job, at least for the core unit suite.

Why it matters

Windows contributors currently cannot get a clean test run from an unmodified checkout, and the Linux-only CI matrix cannot catch these regressions.

Lenguaje dominante
Python
Estrellas
93
Forks
16
Merge medio
11 min
PR fusionados (30 d)
3

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de browserbase/sdk-python

Todos los issues de browserbase/sdk-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.