Add tests for learn's survey API handlers
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- HTML
- Stelle
- 66
- Fork
- 181
- Merge medio
- 2h 21m
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 alphaonelabs/website
-
Rewrite the gsoc/ README for the current site and 2027Forse già presa @KanishJebaMathewM l’ha presa oggi. Aperta2026-11 documentation good first issue gsoc-2027 project: gsoc
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
alphaonelabs/website#1154 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add unit tests for the virtual campus layout logicForse già presa @KanishJebaMathewM l’ha presa oggi. Aperta2026-11 good first issue gsoc-2027 project: virtual tests
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
alphaonelabs/website#1150 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Don't let Mockuper's shortcuts hijack undo and delete while typing in a fieldForse già presa @bfs2021 l’ha presa 1 giorno fa. Aperta2026-11 bug good first issue gsoc-2027 project: mockuper
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
alphaonelabs/website#1147 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Update BotLab's README and CONTRIBUTING for the monorepo and live siteForse già presa @KanishJebaMathewM l’ha presa oggi. Aperta2026-11 documentation good first issue gsoc-2027 project: botlab
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
alphaonelabs/website#1144 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Fix PMOSS docs: broken code blocks, stale repo URLs and database nameForse già presa @KanishJebaMathewM l’ha presa oggi. Aperta2026-11 documentation good first issue gsoc-2027 project: pmoss
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
alphaonelabs/website#1139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alphaonelabs/website
Issue simili
-
area-testing p2-post-1.0 technical-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
follow-up
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
carrick-sh/carrick#1494 ·
I maintainer di solito rispondono entro 1 giorno
-
test(hydro_std): track_membership join and leave are untestedForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
hydro-project/hydro#3289 ·
I maintainer di solito rispondono entro 1 giorno