Publish C-level coverage of the CPython test suite

Ouverte
#94,759 0 commentaires 4 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
github-actions, python
Domaine
ci-cd, testing-qa

Piste de recherche

Commencez par examiner le workflow existant .github/workflows/coverage.yml et la discussion liée sur l’utilisation de clang/llvm-cov. Le MVP proposé est un rapport nocturne de couverture de CPython au niveau C publié via GitHub Pages ; consultez la PR gh-94760 pour voir le travail déjà en cours et ce qu’il reste à faire.

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

Description

tests type-feature

Feature or enhancement

Automatically publish C-level coverage of the CPython test suite.

Pitch

Recent issues, such as the problems with frame.setlineno, have revealed that the C-level coverage of the test suite isn't perfect. While source-level coverage isn't the only metric of a good test suite, paying closer attention to it should help us have more confidence when making changes to the CPython core.

Proposed design for MVP

  • Publish results nightly: This cadence should be enough for most cases. While various tools like codecov.io can run on every pull request, coverage takes a long time to run, and IME, there is enough noise in the results that developers (especially new to the project) would spend a lot of time "chasing" coverage.
  • Use clang/llvm-cov rather than gcc/gcov: As @erlend-aasland pointed out the LLVM toolchain coverage provides branch counts and coverage of subexpressions which seems pretty useful. There is a risk that this isn't the same tooling as most Linux developers would use, and not what make coverage-report does.
  • Publish to Github Pages: The easiest thing seems to be to publish to Github Pages in a new repository in the python org for this purpose. This keeps all of the credential management within Github.

Out of scope

Creating diffs between coverage runs seems like it would be useful, but I haven't found a good tool for that yet.

Python-level coverage reports would likewise be useful, but should be a follow-on to this.

Previous discussion

@brettcannon had set up coverage reports in the past, but they have been broken for a couple of releases. This aims to be simpler than that approach by using a pure Github stack (not using codecov.io) and would just run nightly, not as part of every pull request.

More recent discussion began here: https://github.com/faster-cpython/ideas/issues/426

  • PR: gh-94760
Langage dominant
Python
Étoiles
77.2k
Forks
36k
Merge moyen
1 j 9 h
PR mergées (30 j)
558

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.

Autres issues de python/cpython

Toutes les issues de python/cpython

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

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