SuperAPI AI 工具集

testing-internals

测试与质量

查看项目

更新于 10-15 23:31

技能介绍

用途:说明 IntelliJ 平台仓库中 tests.cmd 的内部执行链路,帮助排查测试执行、发现与运行器相关问题。

主要能力:描述执行链 tests.cmd → Bazel → IdeaUltimateRunTestsBuildTarget → TestingTasksImpl → JUnit 5;列出关键类(TestingOptions、TestingTasksImpl、JUnit5TeamCityRunner、TestCaseLoader、BucketingScheme 等)及各自职责;汇总常见问题与解决方式,如“No tests found”多因模式不匹配(简单类名不生效,需用通配符或全限定名,如 -Dintellij.build.test.patterns=*MyTest)、类不在测试类路径、类名未以 Test 结尾;OutOfMemoryError 可通过 -Dintellij.build.test.jvm.memory.options=-Xmx8g 增大堆;Bazel 构建失败需检查模块依赖并同步 BUILD.bazel(./build/jpsModelToBazel.cmd),且不要用 bazel clean。

使用方式:通过 ./tests.cmd --module <module> --test MyTest 运行;调试可加 -Dintellij.build.test.debug.enabled=true、-Dintellij.build.test.debug.port=5005、-Dintellij.build.test.debug.suspend=true 后附加调试器;并行分桶使用 -Didea.test.runners.count 与 -Didea.test.runner.index;向测试 JVM 传任意属性用 pass. 前缀,如 -Dpass.my.custom.property=value。

适用场景:IntelliJ 平台及其产品(IDEA Ultimate、Community、RustRover、RubyMine、CLion 等)测试模块的本地调试与 CI 排查。

限制:资料未提供各产品专用测试模块的完整清单与版本兼容性说明;部分细节需参考仓库内 TESTING.md。