スキル一覧に戻る

run-puzzle-tests

pjt222
更新日 Yesterday
4 閲覧
17
2
17
GitHubで表示
テストaitestingdesign

について

このスキルは、WSL R実行環境を通じてjigsawRテストスイートを実行し、フルテスト、パターンフィルタリング、または単一ファイル実行をサポートします。合格/不合格/スキップ結果を解釈し、renvを適切にアクティベートするために--vanillaフラグを使用せずに失敗を特定します。開発者は、コード変更後、コミット前、または特定のテスト失敗をデバッグする際に使用すべきです。

クイックインストール

Claude Code

推奨
メイン
npx skills add pjt222/agent-almanac -a claude-code
プラグインコマンド代替
/plugin add https://github.com/pjt222/agent-almanac
Git クローン代替
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/run-puzzle-tests

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Run Puzzle Tests

Run jigsawR test suite. Read results.

When Use

  • After modifying R source in package
  • After adding new puzzle type or feature
  • Before commit to verify nothing broken
  • Debugging specific test failure

Inputs

  • Required: Test scope (full, filtered, single)
  • Optional: Filter pattern (filtered mode, e.g. "snic", "rectangular")
  • Optional: Specific test file path (single mode)

Steps

Step 1: Choose Test Scope

ScopeUse whenDuration
FullBefore commits, after major changes~2-5 min
FilteredWorking on one puzzle type~30s
SingleDebugging a specific test file~10s

Got: Scope selected by workflow: full before commits, filtered for one type, single for one debug.

If fail: Unsure? Default to full. Slower but catches cross-type regressions.

Step 2: Create and Execute Test Script

Full suite.

Make script (e.g., /tmp/run_tests.R).

devtools::test()
R_EXE="/mnt/c/Program Files/R/R-4.5.0/bin/Rscript.exe"
cd /mnt/d/dev/p/jigsawR && "$R_EXE" -e "devtools::test()"

Filtered by pattern.

"$R_EXE" -e "devtools::test(filter = 'snic')"

Single file.

"$R_EXE" -e "testthat::test_file('tests/testthat/test-snic-puzzles.R')"

Got: Test output with pass/fail/skip counts.

If fail:

  • Do NOT use --vanilla flag; renv needs .Rprofile to activate
  • renv errors? Run renv::restore() first
  • Complex commands fail with Exit 5? Write to script file

Step 3: Interpret Results

Look for summary line.

[ FAIL 0 | WARN 0 | SKIP 7 | PASS 2042 ]
  • PASS: Tests succeeded
  • FAIL: Tests failed (need investigation)
  • SKIP: Tests skipped (usually missing optional packages like snic)
  • WARN: Warnings during tests (review but not blocking)

Got: Summary line parsed for PASS, FAIL, SKIP, WARN. FAIL = 0 = clean run.

If fail: Summary not visible? Runner crashed before completing. Check R-level errors above. Output truncated? Redirect to file: "$R_EXE" -e "devtools::test()" > test_results.txt 2>&1.

Step 4: Investigate Failures

If tests fail.

  1. Read failure msg — includes file, line, expected vs actual
  2. Check if new failure or pre-existing
  3. Assertion failures: read test + function being tested
  4. Error failures: check function signature changed
# Run just the failing test with verbose output
"$R_EXE" -e "testthat::test_file('tests/testthat/test-failing.R', reporter = 'summary')"

Got: Root cause of each failing test identified. Failure = real regression (fix code) or test env issue (missing dep, path).

If fail: Failure msg unclear? Add browser() or print() to test, re-run with testthat::test_file() for interactive debug.

Step 5: Verify Skip Reasons

Skipped tests normal when optional deps missing.

  • snic package tests skip with skip_if_not_installed("snic")
  • Tests needing specific OS skip with skip_on_os()
  • CRAN-only skips with skip_on_cran()

Confirm skip reasons legitimate, not masking real failures.

Got: All skips accounted for by legitimate reasons (optional dep, platform skip, CRAN-only). No skips masking actual failures.

If fail: Skip suspicious? Temporarily remove skip_if_*() and run test to see pass or hidden failure.

Checks

  • All tests pass (FAIL = 0)
  • No unexpected warnings
  • Skip count matches expected (only optional dep skips)
  • Test count not decreased (no tests removed by accident)

Pitfalls

  • Use --vanilla: Breaks renv activation. Never with jigsawR.
  • Complex -e strings: Shell escaping = Exit 5. Use script files.
  • Stale package state: Run devtools::load_all() or devtools::document() before testing if NAMESPACE-affecting code changed.
  • Missing test deps: Some tests need suggested packages. Check DESCRIPTION Suggests.
  • Parallel test issues: Tests interfere? Run sequential with testthat::test_file().

See Also

  • generate-puzzle — generate puzzles to verify behavior matches tests
  • add-puzzle-type — new types need comprehensive test suites
  • write-testthat-tests — general patterns for writing R tests
  • validate-piles-notation — test PILES parsing independently

GitHub リポジトリ

pjt222/agent-almanac
パス: i18n/caveman/skills/run-puzzle-tests
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

関連スキル

evaluating-llms-harness

テスト

このClaudeスキルは、lm-evaluation-harnessを実行し、MMLUやGSM8Kなど60以上の標準化学術タスクでLLMをベンチマークします。開発者がモデルの品質を比較し、トレーニングの進捗を追跡し、学術的な結果を報告するために設計されています。このツールはHuggingFaceやvLLMモデルを含む様々なバックエンドをサポートしています。

スキルを見る

cloudflare-cron-triggers

テスト

このスキルは、cron式を使用してWorkersをスケジュールするためのCloudflare Cron Triggersの実装に関する包括的な知識を提供します。定期的なタスクの設定、メンテナンスジョブ、自動化されたワークフローの構築を網羅し、無効なcron式やタイムゾーン問題といった一般的な課題への対処法も含みます。開発者はこれを使用して、スケジュールされたハンドラーの設定、cronトリガーのテスト、WorkflowsやGreen Computeとの連携を構成できます。

スキルを見る

webapp-testing

テスト

このClaude Skillは、Playwrightベースのツールキットを提供し、Pythonスクリプトを通じてローカルWebアプリケーションのテストを可能にします。フロントエンドの検証、UIデバッグ、スクリーンショット撮影、ログ表示を実現し、サーバーライフサイクルを管理します。ブラウザ自動化タスクにご利用いただけますが、コンテキストの汚染を避けるため、スクリプトのソースコードを読むのではなく直接実行してください。

スキルを見る

finishing-a-development-branch

テスト

このスキルは、開発者がテストの合格を確認し、構造化された統合オプションを提示することで、完成した作業を仕上げることを支援します。実装が完了した後のマージ、PR作成、ブランチの整理といったワークフローを案内します。コードが準備できてテスト済みの際に使用し、開発プロセスを体系的に完了させましょう。

スキルを見る