python / python/cpython

Copy files back from Android testbed emulator to host

Ouverte
#149,113 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

OS-android type-feature
Langage dominant
Python
Étoiles
77.2k
Forks
35.9k
Métriques de merge des PR
Métriques de PR en attente

Description

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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par examiner le script android.py et le banc de test Android, puis vérifiez comment managed_device_android_test_additional_output et connected_android_test_additional_output sont utilisés. La modification est terminée lorsqu’un mécanisme générique rend disponibles sur l’hôte, une fois les tests terminés, les fichiers produits sur l’émulateur géré, y compris le fichier .coverage pour un traitement ultérieur.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
android, python
Domaine
mobile, testing
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.