IntelliJプラグインのAnActionと登録設定を実装・変更し、表示文言やアイコンの定義、非同期処理の起動方法を整えます。
- IDEに新しいアクションを追加したいとき
- アクションの登録やアイコンを変更したいとき
- 表示名と説明文の定義を整理したいとき
IntelliJのテストを`bt.cmd`や`tests.cmd`で実行し、対象モジュールやテスト指定の誤り、未検出、ビルド失敗などを切り分けるスキルです。
Run or troubleshoot IntelliJ tests with `bt.cmd` or `tests.cmd`.
実行スコア 未検証
インストール方法を見るIntelliJのテストを実行し、対象クラスやメソッド、パッケージの指定方法を案内します。Bazelで実行できるモジュールにはbt.cmdを使い、未対応のモジュールではtests.cmdに切り替えます。テストクラスが見つからない場合は、完全修飾名やワイルドカード、テストを含むJPSモジュールの指定を確認します。単純なクラス名だけでは検索できない点も扱います。
失敗時には、テスト失敗、ビルド失敗、インフラ障害などの終了コードを手がかりに切り分けます。失敗テストの再試行、テストJVMのメモリ設定、システムプロパティの受け渡し、デバッガ接続の方法も確認できます。別のBazelモジュールに属するテストや、製品のパッケージング変更時に必要なテスト実行方法も案内します。
IntelliJの特定テストだけを実行したいときや、テストが見つからない、メモリ不足になる、ビルド前に失敗するといった問題を調べるときに役立ちます。テストの所属モジュールが不明な場合や、bt.cmdとtests.cmdのどちらを使うべきか判断したい場合にも使えます。
tests.cmdでテストが見つからない原因を切り分けて」テスト実行には対象リポジトリのビルド環境が必要です。独立したBazelモジュールのテストは、そのモジュールの手順に従ってBazelから実行します。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Run the tests of a module with bt first:
./community/tools/bt.cmd --module <module> --filter <FQN>
--module: the JPS module that holds the test classes. Always use the module of the test itself. The module name is the name of the .iml file in the test directory, without the extension.--filter: an FQN, FQN#method, or an all-lowercase package. A package value runs all the test classes in that package.In a community checkout, the wrapper is ./tools/bt.cmd.
# Single test class (FQN)
./community/tools/bt.cmd --module intellij.platform.util.tests \
--filter com.intellij.openapi.util.io.FileUtilLightTest
# Specific test method
./community/tools/bt.cmd --module intellij.platform.util.tests \
--filter 'com.intellij.openapi.util.io.FileUtilLightTest#isAncestor'
# All test classes of a package
./community/tools/bt.cmd --module intellij.platform.util.tests \
--filter com.intellij.openapi.util.io
bt runs a module when the migrated list names it, or when a bt.json area owns its directory. The bt README gives the resolution rules.
| Option | Effect |
|---|---|
--filter <value> | Runs one class, one method, or one package of the target. |
--no-cache | Runs the tests again when Bazel has a cached result. |
--dry-run | Prints the resolved label, the filter, and the Bazel command. Runs nothing. |
--json | Writes one JSON object to stdout and nothing else. |
-- --flaky_test_attempts=3 | Runs a failed test up to 3 times. tests.cmd uses -Dintellij.build.test.attempt.count=3 for this. |
-- --test_arg=--jvm_flag=-Dkey=value | Sets a system property in the test JVM. tests.cmd uses -Dpass.key=value for this. |
-- --test_arg=--jvm_flag=-Xmx8g | Sets the heap of the test JVM. tests.cmd uses -Dintellij.build.test.jvm.memory.options=-Xmx8g for this. |
bt gives all arguments after -- to Bazel without a change. Run ./community/tools/bt.cmd --help for all selectors and options. To attach a debugger, use tests.cmd. The section Additional JVM options shows the flags.
| Exit code | Meaning |
|---|---|
| 0 | All tests passed. |
| 2 | Usage error, or bt refuses the module. |
| 3 | Tests failed. |
| 4 | Zero tests ran. |
| 5 | The build failed before the tests. |
| 6 | Infrastructure failure. |
bt refuses a module whose tests do not run under Bazel yet. It exits with code 2 and prints the tests.cmd command. Run that command:
./tests.cmd --module <module> --test <pattern>
--module — the JPS module containing the test classes (always use the test's own module). To find the module name, look at the .iml file in the test's directory — the module name is the .iml filename without the extension.--test — FQN, wildcard pattern, or FQN#methodName# Single test class (FQN)
./tests.cmd --module intellij.cidr.compiler.custom.tests \
--test com.intellij.cidr.compiler.custom.CidrCustomCompilerReadTest
# Wildcard pattern
./tests.cmd --module intellij.goland.tests \
--test com.goide.comments.*Test
# Specific test method (wildcards cannot be used with #)
./tests.cmd --module intellij.cidr.compiler.custom.tests \
--test com.intellij.cidr.compiler.custom.CidrCustomCompilerReadTest#testSingleDefine
# Multiple (semicolon-separated)
./tests.cmd --module intellij.platform.build.tests \
--test org.jetbrains.intellij.build.TestSelectorsTest#class selector;org.jetbrains.intellij.build.FileSetTest
Simple class names like MyTest do NOT work — always use FQN or wildcard (*MyTest).
Patterns are transformed (* → .*, . → \.) and matched against the fully qualified class name using Pattern.matches() (full-string match):
| Pattern | Regex | Matches org.example.MyTest? |
|---|---|---|
MyTest | MyTest | NO — doesn't cover the package prefix |
*MyTest | .*MyTest | YES |
org.example.MyTest | org\.example\.MyTest | YES |
org.example.* | org\.example\..* | YES |
Use community/tests.cmd for tests that belong to community-only modules:
./community/tests.cmd --module <module> --test <pattern>
In an Ultimate checkout, run ApiCheckTest directly through its Bazel test target. For a focused check, pass one or more comma-separated module names:
bazel test //tests/ideaProjectStructure:projectStructureTests_test \
--test_filter=com.intellij.ideaProjectStructure.api.ApiCheckTest \
--test_arg=--jvm_flag=-Dapi.dump.test.modules.to.check=<module>[,<module>...] \
--test_output=summary \
--test_summary=detailed
Omit --test_arg to check all modules. Do not use bazel run for this target: it streams noisy test output and does not provide Bazel's test summary.
This bt command is the same run with a digest:
./community/tools/bt.cmd //tests/ideaProjectStructure:projectStructureTests_test \
--filter com.intellij.ideaProjectStructure.api.ApiCheckTest \
-- --test_arg=--jvm_flag=-Dapi.dump.test.modules.to.check=<module>[,<module>...]
On failure, keep agent context small by extracting the failing dynamic-test names and messages from Bazel's JUnit report instead of printing the full test.log:
xmllint --xpath '//testcase[failure or error]/@name | //testcase[failure or error]/*[self::failure or self::error]/@message' \
out/bazel-testlogs/tests/ideaProjectStructure/projectStructureTests_test/test.xml
When changing ProductProperties, productImplementationModules, product content descriptors, plugin/module-set packaging, or generated product layout XML, also run:
./community/tools/bt.cmd //build:all-products-packaging_test
The target pins the one class AllProductsPackagingTest and is tagged manual, so no --filter is needed, and no lane or wildcard pattern runs it. bt prints the digest, and Bazel writes out/bazel-testlogs/build/all-products-packaging_test/test.xml. The raw form is ./bazel.cmd test //build:all-products-packaging_test.
When running tests.cmd from PowerShell, pass JVM -D... arguments via stop-parsing mode to avoid argument mangling:
./tests.cmd --% -Dintellij.build.test.patterns=com.example.MyTest
Without --%, PowerShell can alter -D... arguments before they reach tests.cmd, which may lead to errors like Could not find or load main class ....
Some parts of the repository are standalone Bazel modules and must not use tests.cmd or community/tests.cmd. The tests of a module that matches a pattern in the migrated list run only under Bazel. The migrated list is community/build/bazel-migrated-test-modules.txt, or build/bazel-migrated-test-modules.txt in a community checkout. tests.cmd refuses such a module with an error that names the pattern. Run the module with bt:
./community/tools/bt.cmd --module <module> --filter <FQN>
When you have the Bazel label of the target, ./community/tools/bt.cmd <label> --filter <FQN> runs the same target.
community/platform/build-scripts/bazelcommunity/platform/build-scripts/bazel/README.md:cd community/platform/build-scripts/bazel
../../../../bazel.cmd test //:bazel-generator-integration-tests --test_output=all
./tests.cmd for org.jetbrains.intellij.build.bazel.BazelGeneratorIntegrationTests or other tests in that module.community/platform/build-scripts/bazel, prefer that module-local ../../../../bazel.cmd test flow for verification.tests.cmd is a cross-platform script (works on Windows/Linux/macOS)--module and --test, maps them to JVM properties, and calls bazel run //build:local_idea_ultimate_run_tests_build_targetTroubleshooting test discovery:
bazel cleanFor deeper troubleshooting, see TESTING-internals.md.
Usage: tests.cmd --module <module> --test <pattern> [options]
Required:
--module <module> Name of the JPS module which contains the test classes
--test <pattern> Full test class name (FQN) or wild card pattern (e.g. com.intellij.*Test) or exact FQN#methodName
Options:
--debug Debug build scripts JVM process
--help Show this help message
Additional options are passed as JVM flags to org.jetbrains.intellij.build.TestingOptions
Example: -Dintellij.build.test.debug.enabled=true -Dintellij.build.test.debug.suspend=true -Dintellij.build.test.debug.port=5005
Extra -D... arguments are passed through as JVM flags to org.jetbrains.intellij.build.TestingOptions:
-Dintellij.build.test.attempt.count=<n>
-Dintellij.build.test.jvm.memory.options=<options>
-Xmx8g for 8GB heap-Dpass.<property>=<value>
pass. prefix is stripped, so -Dpass.my.flag=true becomes -Dmy.flag=true in the test JVMDebugging: -Dintellij.build.test.debug.enabled=true -Dintellij.build.test.debug.port=5005 -Dintellij.build.test.debug.suspend=true — attach IDE debugger to port 5005.
Tests fail with OutOfMemoryError:
-Dintellij.build.test.jvm.memory.options=-Xmx8gTests not found:
--test uses FQN or wildcard, not simple class name: --test com.example.MyTest--module is the module that actually contains the test class (look at the .iml file location)community/platform/build-scripts/bazel; those tests must be run with module-local ../../../../bazel.cmd test, not tests.cmdtests.cmd refuses the module and names a pattern from bazel-migrated-test-modules.txt, the tests are Bazel-only. Run them with ./community/tools/bt.cmd --module <module> --filter <FQN>, as in Separate Bazel ModulesTests pass locally but fail in CI:
-Dintellij.build.test.attempt.count=3 for flaky testsBazel build fails before tests run:
.iml fileFor deeper troubleshooting, see TESTING-internals.md.
For detailed information about how tests.cmd works internally, including:
For guidelines on writing tests (as opposed to running them), see the guidelines:
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
IntelliJプラグインのAnActionと登録設定を実装・変更し、表示文言やアイコンの定義、非同期処理の起動方法を整えます。
IntelliJのJPSテストモジュールをBazelへ移行し、Bazelだけで起きる失敗を依存関係や実行環境から切り分ける手順を案内します。
IntelliJのKotlin・Javaコードを新規作成やレビューする際に、言語の選び方、書式、型の扱い、例外処理などのプロジェクト規約に沿って整えるスキルです。
IntelliJ向けの変更を適切な単位に分け、チケットの有無に応じた形式で、理由や判断も伝わるコミットメッセージを作成・修正するスキルです。
Pythonコードの型推論や型エラーを複数の型チェッカーで比較し、各ツールの判定と診断内容をまとめたレポートを作成します。
Compose Desktopの画面で状態や副作用をどこに持たせるか整理し、表示と判断の境界、再利用部品やリストの設計を整えます。