본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

testing

`bt.cmd` 또는 `tests.cmd`로 IntelliJ 테스트를 실행하고 테스트 선택, 모듈 지정, 검색 실패, 빌드 실패를 진단합니다. 재시도와 JVM 설정도 다룹니다.

원문원문 설명 보기

Run or troubleshoot IntelliJ tests with `bt.cmd` or `tests.cmd`.

JetBrains/intellij-community스타 20,685(GitHub 20,685 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • 특정 테스트 클래스나 메서드 실행
  • 테스트가 검색되지 않는 원인 조사
  • `bt.cmd`와 `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)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
B일부 부족테스트 실행 명령은 있지만 실행 전 확인 절차는 설명하지 않습니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족대상 저장소의 빌드 환경이 필요하지만 설정 절차는 제공되지 않습니다.

점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md13.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/testing/SKILL.md -->

Testing Guide for IntelliJ IDEA

Quick Start

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.

bt options

OptionEffect
--filter <value>Runs one class, one method, or one package of the target.
--no-cacheRuns the tests again when Bazel has a cached result.
--dry-runPrints the resolved label, the filter, and the Bazel command. Runs nothing.
--jsonWrites one JSON object to stdout and nothing else.
--host <host>Runs the committed HEAD on another machine of the user over yonder. The yonder skill (yonder skill install) gives the rules.
-- --flaky_test_attempts=3Runs a failed test up to 3 times. tests.cmd uses -Dintellij.build.test.attempt.count=3 for this.
-- --test_arg=--jvm_flag=-Dkey=valueSets a system property in the test JVM. tests.cmd uses -Dpass.key=value for this.
-- --test_arg=--jvm_flag=-Xmx8gSets 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 codeMeaning
0All tests passed.
2Usage error, or bt refuses the module.
3Tests failed.
4Zero tests ran.
5The build failed before the tests.
6Infrastructure failure.

The check record and bt build

A green bt run in a linked work tree, such as a Branch Deck lease, records the tree that it saw: one line in bd-checks.jsonl of the git directory. bd lease pick reads the record. A repository can set pick_requires_check in .branchdeck.toml, and then the pick refuses a lease whose tree has no green build or test. A run during which the files changed records nothing. A red run records nothing.

Check the last tree with bt, not with a raw ./bazel.cmd build. bazel.cmd gives the process to bazelisk, so it leaves no record. Commit or delete scratch files before the last check: a record of local changes counts only for a commit of the same files, and bt names those files on the stderr.

./community/tools/bt.cmd build //plugins/air/...     # bazel build -k, one digest line, and the record
./community/tools/bt.cmd build //plugins/air/... --host studio

bt build exits 0 for a green build, 5 for a build failure, and 6 for an infrastructure failure. A --host run records the tree of the commit that ran on the host. The bt README gives the record format.

When bt refuses the module

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).

Why simple names fail

Patterns are transformed (* → .*, . → \.) and matched against the fully qualified class name using Pattern.matches() (full-string match):

PatternRegexMatches org.example.MyTest?
MyTestMyTestNO — doesn't cover the package prefix
*MyTest.*MyTestYES
org.example.MyTestorg\.example\.MyTestYES
org.example.*org\.example\..*YES

Community tests

Use community/tests.cmd for tests that belong to community-only modules:

./community/tests.cmd --module <module> --test <pattern>

API checks via Bazel

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

Product layout and packaging changes

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.

Windows PowerShell note

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 ....

Separate Bazel Modules

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/bazel

  • This directory is a separate Bazel module.
  • Tests in this module must be run via Bazel from that directory.
  • Use the command documented in community/platform/build-scripts/bazel/README.md:
cd community/platform/build-scripts/bazel
../../../../bazel.cmd test //:bazel-generator-integration-tests --test_output=all
  • Do not use ./tests.cmd for org.jetbrains.intellij.build.bazel.BazelGeneratorIntegrationTests or other tests in that module.
  • If a request touches files under community/platform/build-scripts/bazel, prefer that module-local ../../../../bazel.cmd test flow for verification.

How tests.cmd Works

  1. tests.cmd is a cross-platform script (works on Windows/Linux/macOS)
  2. It takes --module and --test, maps them to JVM properties, and calls bazel run //build:local_idea_ultimate_run_tests_build_target
  3. The test runner uses JUnit to execute the specified test classes

Troubleshooting test discovery:

  • Bazel incremental compilation works correctly — remote caches do NOT cause staleness, don't waste time on bazel clean
  • Test discovery issues are typically caused by:
    1. Wrong test pattern (use FQN or wildcard, not simple class name)
    2. Wrong module
    3. Test class not in the correct test module's classpath

For deeper troubleshooting, see TESTING-internals.md.

tests.cmd Parameters

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

Additional JVM options

Extra -D... arguments are passed through as JVM flags to org.jetbrains.intellij.build.TestingOptions:

-Dintellij.build.test.attempt.count=<n>

  • Retry failed tests N times
  • Default: 1 (no retries)
  • Use 3 for flaky tests

-Dintellij.build.test.jvm.memory.options=<options>

  • Custom JVM memory options for the test process
  • Example: -Xmx8g for 8GB heap

-Dpass.<property>=<value>

  • Pass arbitrary system properties to the test JVM
  • The pass. prefix is stripped, so -Dpass.my.flag=true becomes -Dmy.flag=true in the test JVM

Debugging: -Dintellij.build.test.debug.enabled=true -Dintellij.build.test.debug.port=5005 -Dintellij.build.test.debug.suspend=true — attach IDE debugger to port 5005.

Troubleshooting

Tests fail with OutOfMemoryError:

  • Increase heap size: -Dintellij.build.test.jvm.memory.options=-Xmx8g
  • Check for memory leaks in test code

Tests not found:

  • Verify --test uses FQN or wildcard, not simple class name: --test com.example.MyTest
  • Check that --module is the module that actually contains the test class (look at the .iml file location)
  • Before troubleshooting further, check whether the test lives in a separate Bazel module such as community/platform/build-scripts/bazel; those tests must be run with module-local ../../../../bazel.cmd test, not tests.cmd
  • If tests.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 Modules

Tests pass locally but fail in CI:

  • Check test isolation - tests may depend on execution order
  • Verify environment variables and system properties
  • Use -Dintellij.build.test.attempt.count=3 for flaky tests

Bazel build fails before tests run:

For deeper troubleshooting, see TESTING-internals.md.

Test Execution Internals

For detailed information about how tests.cmd works internally, including:

  • Execution flow diagrams
  • Key classes reference
  • TestingOptions properties
  • Bazel target configuration
  • Test discovery flow

See TESTING-internals.md

Writing Tests

For guidelines on writing tests (as opposed to running them), see the guidelines:

  • Writing Tests - How to write tests, always consult before writing new tests

Additional Resources

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

actions

무료요약 있음

IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.

  • IDE 메뉴에 새 동작 추가
  • 동작 등록이나 아이콘 변경
  • 동작 이름과 설명 정리
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

bazel-test-migration

무료요약 있음

IntelliJ JPS 테스트 모듈을 Bazel로 옮기고 Bazel에서만 발생하는 실패를 조사하는 안내서입니다. 의존성, 플러그인, 테스트 데이터와 runfiles 문제를 확인하고 생성된 대상과 이전된 테스트를 검증합니다.

  • 기존 JPS 테스트 모듈을 Bazel로 이전할 때
  • Bazel에서만 실패하는 테스트를 조사할 때
  • 테스트 의존성과 데이터 설정을 확인할 때
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

code-style

무료요약 있음

IntelliJ 프로젝트 규칙에 맞춰 Kotlin과 Java 코드를 작성하거나 검토합니다. 언어 선택, 서식, 봉인 타입, 스레드 주석, 제어 흐름 예외 처리를 확인합니다.

  • IntelliJ 규칙에 맞는 Kotlin 작성
  • Java 코드 검토
  • 예외 처리와 봉인 타입 분기 확인
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

commits

무료요약 있음

이 가이드는 IntelliJ 프로젝트의 변경 사항을 목적별로 나누고 프로젝트 형식에 맞는 커밋 메시지를 작성하도록 돕습니다. 티켓이 있으면 번호와 변경 설명을, 없으면 레이블과 하위 시스템명을 사용하며 필요에 따라 이유와 판단을 본문에 담습니다.

  • 티켓이 있는 변경의 프로젝트 형식 메시지 작성
  • 테스트나 문서 커밋에 적절한 레이블 적용
  • 기존 커밋 메시지를 규칙에 맞게 수정
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

compare-python-typecheckers

무료요약 있음

여러 Python 타입 검사기로 코드 조각이나 파일의 타입 추론과 오류 판정을 비교합니다. 도구별 결과, 실행 시간, 진단 내용을 Markdown 보고서로 모아 저장할 수 있습니다.

  • 검사기별 타입 추론 비교
  • 코드가 타입 오류로 판정되는지 확인
  • 여러 도구의 진단 결과 비교
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

compose-ui-architecture

무료요약 있음

Compose Desktop 화면을 구성할 때 컴포저블은 렌더링을 맡고 프레젠터나 코디네이터는 앱 결정을 맡도록 구조를 정리합니다. 상태 소유권, Effect, 재사용 컴포넌트 API, 지연 목록 키, 애니메이션과 성능을 개별 UI 변경에 맞춰 살펴봅니다.

  • 화면 렌더링과 프레젠터 판단 분리
  • UI 상태를 둘 위치 정리
  • Effect 키와 코루틴 사용 검토
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

JetBrains의 스킬 모두 보기

이 스킬의 문제 신고