← スキル一覧に戻る

test-with-spanner
by nkeonye-akumah
⭐ 93🍴 3📅 2026年1月20日
SKILL.md
name: test-with-spanner description: Run unit tests that require the Spanner emulator. Use this skill when the user wants to run tests in packages like satellite/metabase, satellite/metainfo, or any other tests that interact with Spanner. Automatically handles checking for and configuring the Spanner emulator environment. allowed_tools: echo, go, spanner_emulator
Run Unit Tests with Spanner
You are helping run unit tests that require the Spanner emulator.
Instructions
Follow these steps to run unit tests with Spanner:
-
Check if the Spanner emulator environment is already configured:
- Check if
SPANNER_EMULATOR_HOSTandSTORJ_TEST_SPANNERenvironment variables are set - Use bash to check:
echo $SPANNER_EMULATOR_HOSTandecho $STORJ_TEST_SPANNER
- Check if
-
If environment variables are already set:
- Inform the user that the Spanner emulator environment is already configured
- Show the current values of the environment variables
- Ask the user which test they want to run (package path and optional test name)
- Run the test directly using:
go test -v ./package/path -run TestName
-
If environment variables are NOT set:
- Inform the user that the Spanner emulator needs to be started
- Start the Spanner emulator in the background:
spanner_emulator --host_port 127.0.0.1:10008 - Save the emulator process ID for cleanup later
- Ask the user which test they want to run (package path and optional test name)
- Run the test with environment variables:
SPANNER_EMULATOR_HOST=localhost:10008 \ STORJ_TEST_SPANNER=spanner://127.0.0.1:10008?emulator \ go test -v ./package/path -run TestName - After the test completes, ask the user if they want to stop the emulator or keep it running for more tests
- If they want to stop it, kill the emulator process
-
Report test results:
- Show the test output
- Indicate whether tests passed or failed
- If tests failed, offer to help investigate the failures
Common test paths
Some common test paths in the Storj codebase:
./satellite/metabase- Metabase tests./satellite/metainfo- Metainfo API tests./satellite/satellitedb- Database tests
Notes
- The standard Spanner emulator port is
127.0.0.1:10007but flag--host_port 127.0.0.1:10008can be used to change it. - If the emulator is started, it will continue running until explicitly stopped
- Multiple tests can be run with the same emulator instance
- The emulator process runs in the background and should be cleaned up when done
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です