Add tests for learn's survey API handlers
Los mantenedores suelen responder en 1 día
@KanishJebaMathewM ya está trabajando en esto.
Desde el 3/11/2026.
- #1198 de @KanishJebaMathewM — abierto
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Start with learn/tests/test_quizzes.py to see how MockDB and make_stmt from learn/tests/helpers.py are used, and check learn/tests/conftest.py for the Workers stubs. Then read the six survey handlers in learn/src/worker.py (around lines 3894 to 4201) to see their auth, validation and ownership checks. Done means a new learn/tests/test_surveys.py with a success and a failure test per handler, passing via cd learn && python -m pytest -q in under a second, with worker.py unchanged.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context
learn has six survey endpoints with no tests at all: api_list_surveys (~line 3894), api_create_survey (~3931), api_get_survey (~4075), api_submit_survey (~4087), api_delete_survey (~4163) and api_survey_results (~4201) in learn/src/worker.py. No file under learn/tests/ references them. Run the suite with cd learn && pip install pytest pytest-asyncio && python -m pytest -q (no Cloudflare account needed; tests/conftest.py stubs the Workers runtime).
What to do
- Create
learn/tests/test_surveys.py, following the style oftest_quizzes.py(it uses the sameMockDB/make_stmthelpers). - Cover: unauthenticated requests (401), validation errors (400) on create/submit, a non-owner trying to delete or read results (403/404), and the happy path for each handler.
- If you find a real bug while writing the tests, open a separate issue or fix it in its own commit with a regression test.
Acceptance criteria
- Each of the six handlers has at least one success and one failure test.
- The new file passes locally and does not slow the suite noticeably (< 1 s).
- No changes to
worker.pyunless they fix a bug a new test exposes.
Files
learn/tests/test_surveys.py (new)learn/tests/test_quizzes.py (pattern to copy)learn/tests/helpers.pylearn/src/worker.py (survey handlers)
Helpful links
- learn/public/surveys.html (the UI that calls these endpoints)
Part of GSoC 2027 onboarding — see https://gsoc.alphaonelabs.com
- Lenguaje dominante
- HTML
- Estrellas
- 66
- Forks
- 181
- Merge medio
- 2 h 21 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 alphaonelabs/website
-
Rewrite the gsoc/ README for the current site and 2027Posiblemente ocupada @KanishJebaMathewM la tomó hace 3 días. Abierto2026-11 documentation good first issue gsoc-2027 project: gsoc
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
alphaonelabs/website#1154 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add unit tests for the virtual campus layout logicPosiblemente ocupada @KanishJebaMathewM la tomó hace 3 días. Abierto2026-11 good first issue gsoc-2027 project: virtual tests
Dificultad 2/5 Medio día Aptitud para principiantes 82/100
alphaonelabs/website#1150 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Don't let Mockuper's shortcuts hijack undo and delete while typing in a fieldPosiblemente ocupada @bfs2021 la tomó hace 4 días. Abierto2026-11 bug good first issue gsoc-2027 project: mockuper
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alphaonelabs/website#1147 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Update BotLab's README and CONTRIBUTING for the monorepo and live sitePosiblemente ocupada @KanishJebaMathewM la tomó hace 3 días. Abierto2026-11 documentation good first issue gsoc-2027 project: botlab
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
alphaonelabs/website#1144 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Fix PMOSS docs: broken code blocks, stale repo URLs and database namePosiblemente ocupada @KanishJebaMathewM la tomó hace 3 días. Abierto2026-11 documentation good first issue gsoc-2027 project: pmoss
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
alphaonelabs/website#1139 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de alphaonelabs/website
Issues similares
-
Chip source filter and denial markers miss Storage rows when a Storage activity source is pickedAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
needs-triage presubmit-gate
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
gke-labs/kube-agents#5001 ·
Los mantenedores suelen responder en 1 día
-
crate: spate-core priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ComposioHQ/composio#5249 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
ai-driven-dev/framework#1163 ·
Los mantenedores suelen responder en 1 día