Add tests for learn's survey API handlers
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- HTML
- スター
- 66
- フォーク
- 181
- 平均マージ
- 2時間 21分
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
alphaonelabs/website のほかの issue
-
Rewrite the gsoc/ README for the current site and 2027対応中かも @KanishJebaMathewM が 2 日前に担当しました。 オープン2026-11 documentation good first issue gsoc-2027 project: gsoc
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
alphaonelabs/website#1154 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add unit tests for the virtual campus layout logic対応中かも @KanishJebaMathewM が 2 日前に担当しました。 オープン2026-11 good first issue gsoc-2027 project: virtual tests
難易度 2/5 半日 初心者へのやさしさ 82/100
alphaonelabs/website#1150 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Don't let Mockuper's shortcuts hijack undo and delete while typing in a field対応中かも @bfs2021 が 2 日前に担当しました。 オープン2026-11 bug good first issue gsoc-2027 project: mockuper
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
alphaonelabs/website#1147 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Update BotLab's README and CONTRIBUTING for the monorepo and live site対応中かも @KanishJebaMathewM が 2 日前に担当しました。 オープン2026-11 documentation good first issue gsoc-2027 project: botlab
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
alphaonelabs/website#1144 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Fix PMOSS docs: broken code blocks, stale repo URLs and database name対応中かも @KanishJebaMathewM が 2 日前に担当しました。 オープン2026-11 documentation good first issue gsoc-2027 project: pmoss
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
alphaonelabs/website#1139 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
alphaonelabs/website の issue をすべて見る
似ている issue
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
メンテナーはふだん 2 日以内に返信
-
backend bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
geolens-io/geolens#3639 ·
メンテナーはふだん 1 日以内に返信
-
component:obi contribfest go test
難易度 2/5 1時間未満 初心者へのやさしさ 83/100
open-telemetry/opentelemetry-ebpf-instrumentation#4143 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Automattic/data-liberation-agent#1304 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信