Providing reproduction code for failed test cases
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia dalla segnalazione dei fallimenti relativa a array-api-tests e dall’esempio in array_api_tests/test_manipulation_functions.py::test_repeat; traccia il modo in cui vengono attualmente gestite le chiamate a funzioni fallite e le opzioni CLI. Il lavoro è completo quando per i fallimenti applicabili viene mostrata una riga di riproduzione opzionale e le funzioni mancanti utilizzate per configurare i test producono un errore chiaro, con test che coprono entrambi i comportamenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi all!
Here's one idea on how to potentially improve interacting with failing tests in array-api-tests suite which @ev-br and I discussed this week.
I've been involved in the introduction of array-api-tests suite in a few repositories and, from my personal experience, the activity that took the most of the time was figuring out root causes of failed tests.
Each failure shows the stack trace (or multiple stack traces, if there were e.g. 3 distinct failures for a given test), but at times they are merely related to the actual root cause. For instance, in NumPy we have an xfail:
# fails on np.repeat(np.array([]), np.array([])) edge test case
array_api_tests/test_manipulation_functions.py::test_repeat
which originally was reported by the test suite with an error:
Cannot cast array data from dtype('float64') to dtype('int64')
I had to manually recreate the function call with the exact inputs to understand which edge case we hit. And for each test the error message was either accurate, like missing keyword argument, or irrelevant - which was mostly related to array scalars, Python builtins, or 0-D arrays as inputs or outputs.
From my point of view, one possible improvement of this process could be something like a CLI option --with-repro-snippets, where each failing test is accompanied by a copy-paste line that exactly reproduces it.
So for test_repeat I would get:
Here's a line that reproduces it:
xp.repeat(xp.asarray([]), xp.asarray([]))
The array-api-tests suite would compose it with f"xp.{func_name}({inputs}, {kwargs})" when a function call fails.
This way, when I run a test suite for the first time and get e.g. 50 failures, I can iterate a bit faster by skipping the "reproduce failing code snippet" step. WDYT? Please share your thoughts!
More of a nitpick but some Array API functions are used in multiple tests, like reshape. I think it’s used primarily for setting up inputs for tests. When that one function is missing from the namespace, a large part of the test suite fails with more cryptic error messages. I think that there could be a hasattr(xp, "reshape") decorator for tests and if a function for setting inputs is missing, the error says so.
- Lingua principale
- Python
- Stelle
- 74
- Fork
- 54
- Merge medio
- 4h 35m
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di data-apis/array-api-tests
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
data-apis/array-api-tests#465 · 1 commento ·
-
Test reflected operators?Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
data-apis/array-api-tests#460 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
data-apis/array-api-tests#455 · 2 commenti ·
-
tracking
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
data-apis/array-api-tests#381 · 9 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
data-apis/array-api-tests#368 · 3 commenti ·
Tutte le issue di data-apis/array-api-tests
Issue simili
-
tool-calling
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vllm-project/vllm#59838 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
raullenchai/Rapid-MLX#4042 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
transitmatters/mbta-slow-zone-bot#70 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
litestar-org/advanced-alchemy#811 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno