Providing reproduction code for failed test cases
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
Línea de trabajo
Comienza con la notificación de errores en torno a array-api-tests y el ejemplo de array_api_tests/test_manipulation_functions.py::test_repeat; rastrea cómo se gestionan actualmente las llamadas a funciones fallidas y las opciones de CLI. Se considera terminado cuando se muestra una línea de reproducción opcional para los errores aplicables y las funciones ausentes utilizadas para configurar las pruebas producen un error claro, con pruebas que cubren ambos comportamientos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 74
- Forks
- 54
- Merge medio
- 4 d 15 h
- PR fusionados (30 d)
- 6
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de data-apis/array-api-tests
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 87/100
data-apis/array-api-tests#465 · 1 comentario ·
-
Test reflected operators? Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
data-apis/array-api-tests#460 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
data-apis/array-api-tests#455 · 2 comentarios ·
-
tracking
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
data-apis/array-api-tests#381 · 9 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
data-apis/array-api-tests#368 · 3 comentarios ·
Todos los issues de data-apis/array-api-tests
Issues similares
-
货币战争手改优先级配置缺少列表元素类型校验(P3) Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Abiertoarea: ci bug perceived difficulty: 3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ClickHouse/clickhouse-connect#1057 ·