Skip to content

docs: テスト規約を stub-fetch unit test の実態に合わせる(#55)#58

Merged
yk-lab merged 1 commit into
mainfrom
docs/test-convention
Jun 27, 2026
Merged

docs: テスト規約を stub-fetch unit test の実態に合わせる(#55)#58
yk-lab merged 1 commit into
mainfrom
docs/test-convention

Conversation

@yk-lab

@yk-lab yk-lab commented Jun 27, 2026

Copy link
Copy Markdown
Owner

概要

CLAUDE.md の Conventions「Tests cover pure logic only … Network/IO modules (github, download, install, main) are validated end-to-end by self-test.yml」は実態と乖離していた。実際は HTTP/IO モジュールも境界を mock した決定的な unit testを持つ(github/checksum./fetchdownload@actions/tool-cache + ../src/githubproxyundici)。次に触る人が迷わないよう doc を実態へ合わせる(#42/#54 のレビューで指摘された乖離)。

変更内容

検証

  • ドキュメントのみの変更(コード変更なし)。typos
  • paths-filter で markdown-only と判定され、重い self-test/CI はスキップ(gate は green)

参照

🤖 Generated with Claude Code


Summary by cubic

CLAUDE.md のテスト規約を「Test layering」に更新し、HTTP/IO はネットワークに触れない決定的な unit test(境界を mock)、実 IO は .github/workflows/self-test.yml の E2E で担保する方針を明記。合わせて TODO.md で #55 を解決済みに移動。

Written for commit e3a9c70. Summary will update on new commits.

Review in cubic

CLAUDE.md の「Tests cover pure logic only / Network IO は E2E のみ」は実態と
乖離していた(github/checksum は ./fetch を、download は ../src/github を、
proxy は undici を mock した unit test を持つ)。境界 mock 方針と E2E の役割
分担を明記する Test layering に更新。

- CLAUDE.md: Conventions の Tests 項を実態へ更新
- TODO.md: #55 を解決済み(#58)へ移動

Closes #55

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AECzAv2vcdATecuvLjBSa6
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3668925f-dba4-4018-9177-218561433cf6

📥 Commits

Reviewing files that changed from the base of the PR and between 09231e1 and e3a9c70.

📒 Files selected for processing (2)
  • CLAUDE.md
  • TODO.md

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • テスト方針の説明を更新し、ユニットテストは決定的で実ネットワークに依存しないことを明確化しました。
    • HTTP/IO 関連は境界のモックで検証し、実際の I/O やダウンロード確認はエンドツーエンドで行う方針を追記しました。
    • バックログ整理を行い、完了済みの項目として関連 Issue を移動しました。

Walkthrough

CLAUDE.md のテスト方針説明を1行拡張し、HTTP/IO モジュールの境界モックの具体例(github/checksum./fetch を、download@actions/tool-cache../src/github を、proxyundici をモック)を明記。TODO.md のバックログから Issue #55 を削除し、解決済みセクションへ PR #58 として追記。

Changes

ドキュメント更新

Layer / File(s) Summary
CLAUDE.md テスト方針の更新と TODO 整理
CLAUDE.md, TODO.md
CLAUDE.md のテスト規約を実態に合わせて拡張(モック境界の具体例を追記)。TODO.md のバックログから Issue #55 を削除し、解決済みセクションへ移動。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • yk-lab/setup-task#48: 同様に TODO.md のバックログ Issue を「既に解決した Issue」セクションへ移動する変更を含む。

Poem

🐰 ルールを書き換え、実態に合わせ
モックの境界、はっきり示す
バックログから #55 が消えて
解決済みの列に仲間入り
ドキュメントも、すっきりぴょん! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 変更内容の中心であるテスト規約の実態合わせを簡潔に表しています。
Description check ✅ Passed 概要、関連 issue、検証内容が揃っており、テンプレート要件をほぼ満たしています。
Linked Issues check ✅ Passed #55 の要件どおり、stub fetch の unit test と self-test.yml の E2E の役割分担と download.test.ts との整合が明記されています。
Out of Scope Changes check ✅ Passed 変更は CLAUDE.md と TODO.md の文書整理に限定され、要件外のコード変更はありません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/test-convention

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@yk-lab yk-lab merged commit ecb3f23 into main Jun 27, 2026
21 checks passed
@yk-lab yk-lab deleted the docs/test-convention branch June 27, 2026 13:39
yk-lab added a commit that referenced this pull request Jun 28, 2026
## 概要

`ci.yml` / `self-test.yml` の `dorny/paths-filter` フィルタ `!**/*.md` は
**root 直下の `.md`(`CLAUDE.md` / `TODO.md` / `README.md`
等)にマッチしない**ため、これらだけの PR でも `src = true` と判定され、フル matrix / self-test /
proxy ジョブが走って CI 課金を無駄にしていた。

実例: PR #58(`CLAUDE.md` + `TODO.md` のみ)の `Detect changes` が `Filter src =
true`。

## 変更内容

- `ci.yml` / `self-test.yml` の `changes` フィルタに `- '!*.md'` を追加(root 直下の
`.md` を除外)。`!**/*.md`(サブディレクトリの .md)と併用

## 検証

- `actionlint` ✅ / `typos` ✅
- 本 PR は `.yml` を変更するため `src = true` でフル CI が走る(=挙動は次の **docs-only PR**
で「重いジョブがスキップされる」ことで確認できる)
- 非 .md を含む PR は従来どおりフル CI(回帰なし)

## 参照

- Closes #59
- PR #58(事象が確認できる)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Exclude root-level `.md` files from the `dorny/paths-filter` `src`
filter so docs-only PRs skip heavy CI (matrix/self-test/proxy); non-doc
PRs are unchanged. Implemented by adding `!*.md` alongside `!**/*.md` in
`ci.yml` and `self-test.yml`. Closes #59.

<sup>Written for commit 9912931.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/yk-lab/setup-task/pull/60?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[documentation] テスト規約(CLAUDE.md)を stub-fetch unit test の実態に合わせる

1 participant