Uber

How Uber Executed A JUnit Migration at Massive Scale

Apr 7, 2026
How Uber Executed A JUnit Migration at Massive Scale
SummaryAI, from the source post

This post details the engineering effort behind migrating Uber's Java monorepo from JUnit 4 to JUnit 5. Key contributions include: 1. Developing a custom Bazel test runner to integrate the JUnit Platform (supporting both Vintage and Jupiter engines) with Bazel. 2. Building a custom Bazel aspect to integrate OpenRewrite for automated code refactoring, enabling it to collect source files and compilation classpaths for type resolution. 3. Authoring custom OpenRewrite recipes to handle Uber-specific JUnit 4 test conventions (rules, runners, base classes) and contributing upstream improvements. 4. Implementing precondition recipes within OpenRewrite to filter test files, ensuring only fully transformable targets were processed, thereby maximizing migration scale and minimizing manual intervention. 5. Describing the end-to-end workflow for migrating test targets, including the generation of patch files and diagnostic datatables.