IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.
- IDE 메뉴에 새 동작 추가
- 동작 등록이나 아이콘 변경
- 동작 이름과 설명 정리
IntelliJ 코드베이스의 JUnit 5 테스트를 작성하고 검토합니다. 대상 테스트 모듈 선택, 프로젝트 픽스처와 수명 주기 어노테이션 사용, 코루틴 및 UI 스레드 작업을 명확한 테스트 범위 안에서 처리하는 방법을 안내합니다.
Write IntelliJ JUnit 5 tests with fixtures, lifecycle, and EDT.
실행 점수 미검증
설치 방법 보기이 스킬은 IntelliJ 코드베이스의 JUnit 5 테스트를 작성하고 검토합니다. 대상 프로덕션 모듈에 대응하는 테스트 모듈을 고르고, @TestApplication, 프로젝트 픽스처, @TestDisposable 등을 사용해 테스트를 구성하도록 안내합니다. 설정과 정리에는 JUnit 5 수명 주기 어노테이션을 사용하고, 코루틴 테스트는 timeoutRunBlocking을 경계로 삼습니다. 적절한 디스패처에서 UI 작업만 실행하는 방법과 고정 대기 시간 대신 완료 신호를 사용하는 방식도 다룹니다.
IntelliJ 모듈에 테스트를 추가하거나 기존 테스트의 픽스처, 리소스 정리, UI 스레드 사용을 검토할 때 유용합니다. JUnit 4 형식에서 JUnit 5로 옮기거나 코루틴이 포함된 테스트를 작성할 때도 사용할 수 있습니다.
대상은 IntelliJ 코드베이스의 테스트입니다. 명령줄 실행 예시는 ./tests.cmd --module <test-module> --test com.example.MyTest입니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Guidelines for writing tests in IntelliJ IDEA codebase.
For examples, see community/platform/testFramework/junit5/test/showcase/.
Put a test in the test module associated with the production module it exercises. Do not place it in a downstream module merely because
that module has the production module on its test classpath. Check the production module's .iml file and neighboring tests before adding
a new test.
In particular, code in org.jetbrains.intellij.build.io under community/build/tasks belongs to
intellij.idea.community.build.tasks.tests (community/build/tasks/test), not intellij.platform.buildScripts.tests. The
BUILD_SCRIPTS_PLATFORM_TESTS group deliberately excludes org.jetbrains.intellij.build.io.* to avoid matching build-task tests by class
name across module boundaries. Putting such a test in the build-scripts test module leaves it outside every community test group and causes
UltimateProjectTestsStructureTest to fail.
Use JUnit 5 with @TestApplication annotation instead of extending LightJavaCodeInsightFixtureTestCase.
Why JUnit 5:
@TestDisposable, @RegistryKey) instead of manual setup/teardownUse companion object fixtures shared between all tests:
@TestApplication
internal class MyTest {
companion object {
private val projectFixture = projectFixture()
private val moduleFixture = projectFixture.moduleFixture("src")
}
private val project get() = projectFixture.get()
private val module get() = moduleFixture.get()
}
Use JUnit 5 lifecycle annotations for setup and teardown:
@TestApplication
internal class MyTest {
companion object {
@JvmStatic
@BeforeAll
fun setUpClass() {
// Once before all tests in class
}
@JvmStatic
@AfterAll
fun tearDownClass() {
// Once after all tests in class
}
}
@BeforeEach
fun setUp() {
// Before each test method
}
@AfterEach
fun tearDown() {
// After each test method
}
}
Note: Prefer @TestDisposable over manual @AfterEach cleanup for resources.
Use @TestDisposable annotation to inject test-scoped disposables (created before each test, disposed after):
@TestDisposable
lateinit var disposable: Disposable
// Or as parameter
@Test
fun myTest(@TestDisposable disposable: Disposable) { ... }
Use @RegistryKey annotation instead of Registry.get().setValue():
@Test
@RegistryKey(key = "my.registry.key", value = "true")
fun testWithRegistryEnabled() { ... }
Use @SystemProperty annotation instead of System.setProperty():
@Test
@SystemProperty(propertyKey = "my.property", propertyValue = "value")
fun testWithSystemProperty() { ... }
Use com.intellij.testFramework.common.timeoutRunBlocking as the coroutine boundary. It has a 10-second default timeout, so a
suspended test fails quickly with a coroutine-aware thread dump. Do not add a JUnit @Timeout to such a test. The two timeouts
duplicate each other, and the @Timeout gives a worse diagnostic.
Keep setup, background work, and assertions off the UI thread. Move only Swing operations into a small
withContext(Dispatchers.UI) block:
@Test
fun updatesLabel(): Unit = timeoutRunBlocking {
val value = loadValue()
val actual = withContext(Dispatchers.UI) {
label.text = value
label.text
}
assertThat(actual).isEqualTo(value)
}
Dispatchers.UI is strict: it supplies UI-thread affinity without implicit model access. Use Dispatchers.EDT only when the tested
operation genuinely requires model or lock access and cannot be split from the UI operation. Keep write actions explicit.
Editor creation/disposal, editor document mutation, completion invocation, action-group expansion, and file-editor operations are common
model-backed exceptions. Keep their full synchronous lifecycle in a narrow Dispatchers.EDT block; do not construct on strict UI and
dispose later from a different dispatcher.
Do not use @RunInEdt, @RunMethodInEdt, runInEdtAndWait, or runInEdtAndGet in new tests. They hide the coroutine boundary,
move lifecycle methods and assertions onto EDT, and can accidentally grant model or write-intent access.
When a synchronous callback API cannot call a suspending function, use a narrow bounded adapter around that callback only:
timeoutRunBlocking(timeout = 10.seconds, context = Dispatchers.UI) {
createSwingComponent()
}
Prefer observable completion signals, flows, latches, or virtual time over sleeps. If polling is unavoidable, bound it and make the
predicate suspending so UI checks can use withContext(Dispatchers.UI) without nested blocking.
Use the enclosing test scope for launched work: pass this from timeoutRunBlocking/coroutineScope, or backgroundScope from
runTest, into the code under test. Create a standalone CoroutineScope(...) only when independent scope lifetime is itself under test;
parent it to the test job and cancel it in finally. Use delay freely with runTest virtual time, but do not use a real timing-only
delay as a completion signal.
com.intellij.testFramework.junit5.TestApplication - initializes shared applicationcom.intellij.testFramework.junit5.TestDisposable - injects test disposablescom.intellij.testFramework.junit5.RegistryKey - sets registry valuescom.intellij.testFramework.junit5.SystemProperty - sets system propertiescom.intellij.testFramework.common.timeoutRunBlocking - runs suspending test code with a 10-second default timeoutcom.intellij.testFramework.junit5.fixture.projectFixture - creates project fixturescom.intellij.testFramework.junit5.fixture.moduleFixture - creates module fixturesJUnit5ProjectFixtureTest.kt - project fixture patternsJUnit5DisposableTest.kt - disposable injectionJUnit5SystemPropertyTest.kt - system property usageJUnit5RunInEdtTest.java - legacy EDT extension behavior; do not copy it for new testsTo run tests via command line, see TESTING.md.
Quick example:
./tests.cmd --module <test-module> --test com.example.MyTest
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.
IntelliJ JPS 테스트 모듈을 Bazel로 옮기고 Bazel에서만 발생하는 실패를 조사하는 안내서입니다. 의존성, 플러그인, 테스트 데이터와 runfiles 문제를 확인하고 생성된 대상과 이전된 테스트를 검증합니다.
IntelliJ 프로젝트 규칙에 맞춰 Kotlin과 Java 코드를 작성하거나 검토합니다. 언어 선택, 서식, 봉인 타입, 스레드 주석, 제어 흐름 예외 처리를 확인합니다.
이 가이드는 IntelliJ 프로젝트의 변경 사항을 목적별로 나누고 프로젝트 형식에 맞는 커밋 메시지를 작성하도록 돕습니다. 티켓이 있으면 번호와 변경 설명을, 없으면 레이블과 하위 시스템명을 사용하며 필요에 따라 이유와 판단을 본문에 담습니다.
여러 Python 타입 검사기로 코드 조각이나 파일의 타입 추론과 오류 판정을 비교합니다. 도구별 결과, 실행 시간, 진단 내용을 Markdown 보고서로 모아 저장할 수 있습니다.
Compose Desktop 화면을 구성할 때 컴포저블은 렌더링을 맡고 프레젠터나 코디네이터는 앱 결정을 맡도록 구조를 정리합니다. 상태 소유권, Effect, 재사용 컴포넌트 API, 지연 목록 키, 애니메이션과 성능을 개별 UI 변경에 맞춰 살펴봅니다.