bazel-contrib / bazel-contrib/rules_python

Exec py_test targets in a way that would work with --run_under=lldb

Aperta
#2,104 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

# 🚀 feature request

### Description

When you're debugging python targets that load python C extensions, it can be useful in general to run something like `lldb -- python3 -m pytest path/to/tests`. In bazel I would envision this as `bazel test --run_under=lldb :tests`, but this doesn't work currently since py_test execs a script with a shebang. I think in theory if py_test ran the equivalent of `python3 path/to/script` it could "just work" but I'm not sure.

### Describe alternatives you've considered

You can try to catch the process by launching the debugger elsewhere like `lldb --wait-for -n python3.11`, but this is a bit fragile since you could catch the wrong process

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal percorso di esecuzione di py_test e traccia il modo in cui `bazel test --run_under=lldb :tests` invoca lo script di test generato. Confronta l’esecuzione attuale basata sullo shebang con il comportamento richiesto `python3 path/to/script`, quindi verifica che un test Python C-extension venga avviato sotto LLDB, mentre la normale esecuzione di py_test rimanga invariata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system, testing
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.