本文へ移動
cccskills
無料GitHub で公開日本語紹介

migrate-pytest

pytestの統合テストを分析し、シナリオや構成を整理したうえで、test-loop形式のテストへ移行する計画と実装を進めるスキルです。

原文原文の説明を見る

Migrate a pytest integration test to the test-loop framework. Use when converting a pytest from pytest/tests/ to a deterministic test-loop test.

near/nearcoreスター 2,621(GitHub 2,621 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • pytestをtest-loopへ移行したいとき
  • 統合テストの移行手順を整理したいとき
  • 決定的なテストへ置き換えたいとき
  • 移行後のテストと参照を整えたいとき

日本語での紹介

できること

指定されたpytestファイルを読み、各テストシナリオの検証内容、ノード構成、主要設定、操作の順序、アサーションを整理します。分析結果はプロジェクトルートの<test_name>_migration.mdに記録し、test-loopのREADMEや関連する例、既存テストを調べて移行案を作ります。案を提示して確認を得た後、新しいテストファイルを作成し、テストモジュールへの登録、コンパイルと個別テストの実行、整形を行います。最後に元のpytestと関連参照を削除します。

こんなときに便利

pytest/tests/にある統合テストを、決定的な結果を得られるtest-loopテストへ移したいときに使えます。既存テストの動作やネットワーク構成を把握しながら、移行内容を記録して進めたい場合に向いています。

使い方の例

  • 「このpytestをtest-loopに移行して」
  • 「pytest/tests/example.pyを移行して」
  • 「この統合テストのシナリオを整理して移行案を作って」

注意点

test-loop-testsのREADME、例、既存テストを参照します。テスト作成前に移行案の確認が必要です。手順にはコンパイルとテストの実行、元pytestファイルの削除が含まれます。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Migrate a pytest integration test to the test-loop framework.

Target pytest file: $ARGUMENTS

Follow these steps in order:

1. Understand the pytest

  • Read the target pytest file
  • Identify each distinct test scenario (steps, test methods, or test functions)
  • For each scenario, write in details:
    • What is being tested (the behavior under test)
    • The network topology (how many validators, archival nodes, RPC nodes, observers)
    • Key configuration (epoch_length, gc settings, archive mode, split storage, etc.)
    • The sequence of actions (start nodes, wait for blocks, kill/restart, send txs, etc.)
    • The assertions (what is verified and how)
  • Present this analysis to the user before proceeding
  • Write this analysis into <test_name>_migration.md in the project root.

2. Study the test-loop framework

  • Read test-loop-tests/README.md for the builder API and patterns
  • Read relevant examples from test-loop-tests/src/examples/ that are relevant to the pytest being migrated (list available examples with ls test-loop-tests/src/examples/)
  • Browse existing tests in test-loop-tests/src/tests/ for patterns similar to what the pytest does

3. Design the test-loop test

For each pytest scenario, decide:

  • Whether it maps to a separate #[test] function or can be combined
  • The simplest builder API setup that covers the scenario
  • Which test-loop utilities to use (runners, node accessors, transactions)
  • Whether any simplification is appropriate (the README says: "it would be extremely hard to migrate the logic precisely. Instead, migrate tests only if they make sense to you")

Present the plan to the user and get confirmation before writing code.

4. Write the test

  • Create test-loop-tests/src/tests/<test_name>.rs
  • Follow the instructions in test-loop-tests/README.md
  • Register the module in test-loop-tests/src/tests/mod.rs (keep alphabetical order)

5. Verify

  • Run cargo check --package test-loop-tests --features test_features to verify compilation
  • Run each test individually: cargo test --package test-loop-tests --features test_features -- tests::<module>::<test_name> --exact --show-output
  • Fix any compilation errors or test failures
  • Run cargo fmt --package test-loop-tests

6. Clean up the pytest

  • Delete the original pytest file
  • Remove its entries from nightly/pytest-sanity.txt (check for both regular and --features nightly variants, and commented-out spice variants)
  • Search for any other references to the pytest filename

7. Summary

Report what was done:

  • Which pytest scenarios were migrated (and any that were intentionally simplified or skipped)
  • The new test file location and test function names
  • Approximate runtime comparison if available

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

NEAR Protocolの最低対応バージョンを1つ引き上げ、旧バージョン向けの機能や設定差分を整理して、検証とPR作成まで進めるスキルです。

  • 旧プロトコルバージョンを廃止したいとき
  • 機能フラグと設定差分をまとめて整理
  • バージョン引き上げを一つのPRにまとめる
near/nearcore2,6212026年10月29日 更新

pr

無料概要あり

ステージ済みの変更を読み取り、ブランチ名やタイトル、説明を整えて、確認後にGitHubへドラフトのプルリクエストを作成するスキルです。

  • ステージ済みの変更をPRにしたいとき
  • コードレビューを依頼したいとき
  • 作業をドラフトPRで共有したいとき
near/nearcore2,6212026年10月29日 更新

pr-review

無料概要あり

Rustのプルリクエストをプロジェクトの基準に沿って調べ、マージを妨げる不具合や安全性、性能、セキュリティ上の問題を具体的に指摘するスキルです。

  • RustのPRをマージ前にレビューしたいとき
  • ブランチの差分を点検したいとき
  • 本番運用上の問題を探したいとき
near/nearcore2,6212026年10月29日 更新

update-generated

無料概要あり

OpenAPI仕様、Instaスナップショット、プロトコルスキーマを順に再生成し、失敗時は停止して差分確認が必要な変更を扱うスキルです。

  • 生成ファイルを更新したいとき
  • スナップショットを再生成したいとき
  • OpenAPI仕様を更新したいとき
near/nearcore2,6212026年10月29日 更新

near のスキルをすべて見る

このスキルの問題を報告する