用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/JetBrains/intellij-community --skill testing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | testing |
| description | Run or troubleshoot IntelliJ `tests.cmd` tests and discovery. |
./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.
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:
./tests.cmd --module intellij.idea.ultimate.build.tests --test com.intellij.idea.ultimate.build.smokeTests.AllProductsPackagingTest
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.
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)Test (or use -Dpass.idea.include.unconventionally.named.tests=true)community/platform/build-scripts/bazel; those tests must be run with module-local ../../../../bazel.cmd test, not tests.cmdTests 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:
Convert Product DSL module sets into bundled wrapper plugins.
Convert Product DSL module sets into bundled wrapper plugins.
Migrate IntelliJ JPS module tests to Bazel and debug Bazel-only test/runtime/plugin dependency failures.