Skip to content

[Maintenance] Track migration from BasePlatformTestCase to native JUnit 5 fixtures #32

Description

@YangSiJun528

Summary

Track the upstream support and prerequisites required to migrate the remaining IntelliJ Platform fixture tests from BasePlatformTestCase and JUnit Vintage to native JUnit Jupiter fixtures.

This is a tracking issue rather than an immediate implementation task. It does not block standalone unit tests or visual tests from using Jupiter.

Current state

  • The plugin supports IntelliJ Platform builds starting from 241.
  • General tests currently target IntelliJ IDEA Community 2024.1.7.
  • The current test configuration uses:
    • junit:junit:4.13.2;
    • archunit-junit4;
    • TestFrameworkType.Platform.
  • The current baseline is 45 test classes and 286 tests.
  • 28 classes and 186 tests depend on BasePlatformTestCase or related JUnit 3-style fixtures.
  • The remaining tests consist of 95 JUnit 4 tests and 5 ArchUnit rules.
  • IntelliJ Platform 2024.1.7 does not provide the complete composable JUnit 5 fixture API required to replace myFixture, including projectFixture(), moduleFixture(), and codeInsightFixture().

Switching only to useJUnitPlatform() without the Vintage engine would silently stop discovering the existing BasePlatformTestCase tests.

Upstream context

JetBrains/intellij-platform-plugin-template#537 proposed replacing the previous UI Test Robot setup with IntelliJ IDE Starter.

The proposed structure:

  • retained JUnit 4 and TestFrameworkType.Platform for the general test source set;
  • added a separate uiTest source set and Gradle task;
  • configured only uiTest with:
    • TestFrameworkType.Starter;
    • TestFrameworkType.JUnit5;
    • JUnit Jupiter;
    • JUnit Platform Launcher;
    • useJUnitPlatform();
  • kept UI tests separate from the normal check workflow.

The PR was closed without being merged and is not present in the current template. It should therefore be treated as a design reference rather than an officially adopted template configuration.

Decision for now

  • Keep existing BasePlatformTestCase tests compatible through the Vintage engine if the general test task is moved to JUnit Platform.
  • Allow standalone unit tests to migrate to Jupiter independently.
  • Add visual tests through a separate JUnit 5 source set and task.
  • Keep visual-test implementation separate from this migration.
  • Do not raise the minimum supported IntelliJ Platform version solely to remove Vintage.

Revisit when

Re-evaluate the migration when one or more of the following occurs:

  • the minimum supported IntelliJ Platform version is raised;
  • the published test framework for the minimum version provides stable project, module, editor, and code-insight fixtures;
  • the official IntelliJ Platform plugin template adopts native Jupiter fixtures for general tests;
  • BasePlatformTestCase or the Vintage engine is deprecated;
  • the JUnit 4 runtime workaround for test-framework-junit5 is no longer required.

Migration scope

When the prerequisites are satisfied:

  • replace BasePlatformTestCase inheritance with native Jupiter fixtures;
  • convert the remaining JUnit 4 annotations and timeout declarations;
  • migrate ArchUnit to its JUnit 5 engine;
  • remove the Vintage engine;
  • remove junit:junit and archunit-junit4;
  • preserve the existing test coverage and discovery baseline.

Acceptance criteria

  • All tests run through the Jupiter engine.
  • No test depends on BasePlatformTestCase or JUnit 3-style testXxx() discovery.
  • No JUnit 4 runner or Vintage dependency remains.
  • At least the existing 45 classes and 286 tests are discovered.
  • The complete suite passes against every supported IntelliJ Platform version.
  • Test-count verification prevents silent test omission during migration.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions