python / python/cpython

Copy files back from Android testbed emulator to host

Abierto
#149,113 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

OS-android type-feature
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

Feature or enhancement

Proposal:

Currently I am trying to add Android support for aiohttp and I am using cibuildwheel to build an test the wheel. For simplicity I am using the default managed Android emulator.

One missing piece, however, is measuring the code coverage of the tests. It is possible to track coverage using pytest-cov, but I haven’t yet found a way to copy the generated .coverage file from the managed Android emulator back to the host PC for further processing. Using adb pull doesn’t work, since the managed Android emulators shut down automatically after the tests. Of course, I could work with a connected Android emulator where the emulator stays on after the tests, allowing me to copy the necessary data using adb pull, but then I would have to manually start an Android emulator before calling cibuildwheel. I would prefer to avoid this extra effort.

Therefore, I suggest modifying the android.py script and the Android testbed to provide a generic way to copy data from the Android emulator back to the host. Here are a few ideas I have:

On idea is to copy the encode files as base64 and output them via logcat. This would be a simple but probably not very practical approach, especially if the files are large.

A propably better solution would be to use the (pretty bad documented) folders build/outputs/managed_device_android_test_additional_output and build/outputs/connected_android_test_additional_output to copy files from the emulator to the host. See for example here or here.

As far as I can tell, this feature would actually only be relevant for third-party packages built using cibuildwheel, for example. However, since cibuildwheel uses the android.py script and the Android testbed project from CPython, such a feature would need to be added to CPython and cannot be implemented within cibuildwheel itself.

I already have a working draft that uses managed_device_android_test_additional_output, but I wanted to discuss this first to see if it’s a useful addition or if it’s actually out of scope for CPython?

@mhsmith What do you think?

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs
  • gh-149271

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.

Línea de trabajo

Comienza inspeccionando el script android.py y el testbed de Android; después, revisa cómo se utilizan managed_device_android_test_additional_output y connected_android_test_additional_output. El cambio estará terminado cuando un mecanismo genérico haga que los archivos producidos en el emulador administrado estén disponibles en el host una vez finalizadas las pruebas, incluido el archivo .coverage para su procesamiento posterior.

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

Evaluación

Stack tecnológico
android, python
Área
mobile, testing
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.