Skip to content

Comments

Update roborazzi to v1.59.0#151

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/roborazzi
Open

Update roborazzi to v1.59.0#151
renovate[bot] wants to merge 1 commit intomainfrom
renovate/roborazzi

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jun 1, 2025

This PR contains the following updates:

Package Change Age Confidence
io.github.takahirom.roborazzi:roborazzi-compose-preview-scanner-support 1.43.11.59.0 age confidence
io.github.takahirom.roborazzi:roborazzi-junit-rule 1.43.11.59.0 age confidence
io.github.takahirom.roborazzi:roborazzi-compose 1.43.11.59.0 age confidence
io.github.takahirom.roborazzi:roborazzi 1.43.11.59.0 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

takahirom/roborazzi (io.github.takahirom.roborazzi:roborazzi-compose-preview-scanner-support)

v1.59.0

Compare Source

ROBORAZZI_DEBUG can now be passed as a command-line parameter

We already have the ROBORAZZI_DEBUG variable to control debug-log output, and it can be set in tests. From this release, you can also enable ROBORAZZI_DEBUG by adding -Proborazzi.debug=true to the command line.

What's Changed

Full Changelog: takahirom/roborazzi@1.58.0...1.59.0

v1.58.0

Compare Source

Bugfix: Fixed NoClassDefFoundError in RoborazziPlugin when the Android Plugin is not applied

Previously, we never touched the Android Plugin class when it wasn’t in use; nevertheless, a NoClassDefFoundError was raised because the plugin contained a method that referenced the Android Plugin class. I therefore extracted Android-related code into a separate class to resolve the issue. Thank you, @​rnett, for reporting this.

Update: Device qualifiers

You can now specify device qualifiers via RobolectricDeviceQualifiers. The list has been expanded with new devices such as Pixel9, XRGlasses, and even AIGlasses!
Thank you, @​joergmis, for your contribution.

What's Changed

New Contributors

Full Changelog: takahirom/roborazzi@1.57.0...1.58.0

v1.57.0

Compare Source

Fix AGP 9.0 KMP preview screenshots

We had been using unitTestSources?.**java**?.addGeneratedSourceDirectory, but this approach proved ineffective when we adopted com.android.kotlin.multiplatform.library. Consequently, we migrated to unitTestSources?.**kotlin**?.addGeneratedSourceDirectory for the KMP plugin. Unfortunately, when applying com.android.library, unitTestSources?.kotlin remains non-functional, so we must toggle between the two depending on the plugin.
Thank you for reporting this @​HLCaptain !

(This is our plugin code, you don't have to write this.)

  val isKmpLibrary = project.plugins.hasPlugin("com.android.kotlin.multiplatform.library")
  if (isKmpLibrary) {
    unitTestSources?.kotlin?.addGeneratedSourceDirectory(
      generateTestsTask,
      GenerateComposePreviewRobolectricTestsTask::outputDir
    )
  } else {
    unitTestSources?.java?.addGeneratedSourceDirectory(
      generateTestsTask,
      GenerateComposePreviewRobolectricTestsTask::outputDir
    )
  }
Bugfix: Compose Preview’s onSizeChanged{} wasn’t called when multiple windows exist.

There is a bug in which Compose Preview’s onSizeChanged{} fails to fire when multiple windows are present. This issue arises because we neglected to invoke

      composeTestRule.mainClock.advanceTimeByFrame()
      composeTestRule.waitForIdle()

Reproducing screenshots image

What's Changed

Full Changelog: takahirom/roborazzi@1.56.0...1.57.0

v1.56.0

Compare Source

Added AGP 9.0 compatibility to RoborazziPlugin

Roborazzi was previously using APIs and classes that have since been deprecated, such as Variant.unitTest and TestedExtension. We have now migrated to alternative, supported classes and methods. Thanks for reporting this, @​allanconda-mercari !

Behavior changes: Stabilized preview LaunchedEffect execution for Compose Preview support

Previously, screenshots occasionally differed from Android Studio Composable Preview when using LaunchedEffect. We now invoke composeTestRule.mainClock.advanceTimeByFrame() by default, so some screenshots may appear different. You can restore the previous behavior by implementing a custom tester as follows:

composeRuleFactory = { createAndroidComposeRule<RoborazziActivity>() as AndroidComposeTestRule<ActivityScenarioRule<out ComponentActivity>, *> },
What's Changed

Full Changelog: takahirom/roborazzi@1.55.0...1.56.0

v1.55.0

Compare Source

Bugfix: Fix WebP ClassCastException

What happened
  • Robolectric runs inside a custom class loader named SdkSandboxClassLoader.
  • Roborazzi's WebP support relies on ImageIO.getImageWritersByMIMEType, which internally caches writers in a static field. When the writer is first created, the code is executed by SdkSandboxClassLoader1.
  • Subsequently, when another test runs with a different SDK (e.g., 35), a second SdkSandboxClassLoader (SdkSandboxClassLoader2) is spawned. Because ImageIO's cached instance was loaded by a different class loader, attempting to cast it triggers a ClassCastException.

class com.luciad.imageio.webp.WebPWriteParam cannot be cast to class com.luciad.imageio.webp.WebPWriteParam (com.luciad.imageio.webp.WebPWriteParam is in unnamed module of loader org.robolectric.internal.AndroidSandbox$SdkSandboxClassLoader @​1dbb650b; com.luciad.imageio.webp.WebPWriteParam is in unnamed module of loader org.robolectric.internal.AndroidSandbox$SdkSandboxClassLoader @​3e48e859)

What we did

We leveraged reflection to force ImageIO.getImageWritersByMIMEType to use the System ClassLoader, thereby guaranteeing that the same class definition is shared irrespective of the current SdkSandboxClassLoader.
Many thanks to @​eygraber for reporting this bug!

What's Changed

Full Changelog: takahirom/roborazzi@1.54.0...1.55.0

v1.54.0

Compare Source

Breaking change: Report HTML and JSON paths have changed

The HTML report used to be at build/reports/roborazzi/index.html but is now located at build/reports/roborazzi/<build_variant>/index.html. This is a first step toward fixing a long-standing issue where running recordRoborazzi (instead of recordRoborazziDebug) could break test results; further work is still needed to make it fully reliable.

You should be able to fix it by adding /debug/ (or your build variant) to the path in your CI script. I believe the change is straightforward, but if you run into any cases where it's difficult please let me know.

Note: This change does not affect the paths of the generated screenshot images, so most users will not be impacted.

Thank you for your contribution, @​vladcudoidem!

Behavioral change: Fixed screenshot timing for Compose Preview Support

Previously, we used Espresso.onIdle() and ShadowLooper.idle(), but these APIs are not suitable for Compose. Consequently, screenshots could not be captured after onSizeChanged completed.

@&#8203;Preview
@&#8203;Composable
fun PreviewOnSizeChanged() {
  var size by remember { mutableStateOf("unknown") }
  Box(
    modifier = Modifier
      .size(100.dp)
      .background(Color.Blue)
      .onSizeChanged { size = "${it.width}x${it.height}" } // Now invoked! (It used to be skipped.)
  ) {
    Text(text = size, color = Color.White)
  }
}

If you encounter issues with infinite animations—such as CircularProgressIndicator—you can configure frame-based captures using @RoboComposePreviewOptions.

@&#8203;RoboComposePreviewOptions(
  manualClockOptions = [ManualClockOptions(advanceTimeMillis = 0L)]
)

Thank you for reporting this issue, @​savvasenok!

What's Changed

Full Changelog: takahirom/roborazzi@1.53.0...1.54.0

v1.53.0

Compare Source

New feature generatedTestClassCount and behavior changes to Compose Preview support

We've added the generatedTestClassCount option, which enables us to run Preview tests in parallel when you set maxParallelForks to a value greater than 1.

roborazzi {
  generateComposePreviewRobolectricTests {
    generatedTestClassCount = 4
  }
}

As the name generatedTestClassCount suggests, this option generates as many test classes as specified. It creates tests whose previewIndex % totalTestClassCount == testClassIndex. However, this option does not modify maxParallelForks, so you must also set maxParallelForks yourself to run tests in parallel. This is our policy: we never alter other plugin(AGP) settings in order to keep one single source of configuration.

Behavior changes: generatedTestClassCount now defaults to the same value as maxParallelForks. Therefore, if you already use maxParallelForks during testing, the behavior may change if your tests are non-deterministic—for example, if they depend on the order in which other tests run.

Last but not least, thanks to @​sergio-sastre for suggesting this feature, reviewing the code, and confirming the approach works!

Fix configuration-time resolution when using BOM to Compose Preview support

Fixed an error where the version verification logic triggered configuration-time resolution errors when using BOM (Bill of Materials) for dependency management.

The fix simplifies the verifyComposablePreviewScannerVersion method by removing the complex fallback logic that attempted to infer versions from test configurations. Instead, the plugin now only checks explicitly declared versions—when no version is specified (indicating BOM management), verification is skipped.

Thanks to @​igokoro for reporting this issue!

Fix iOS snapshot not creating parent directories before writing files

Fixed a critical bug where iOS snapshot tests weren't being recorded on the first run. The root cause was that NSData.writeToFile silently fails when parent directories don't exist.

The fix ensures parent directories are automatically created before writing files using NSFileManager.defaultManager.createDirectoryAtPath with withIntermediateDirectories = true. Additionally, error logging was added to report both successful and failed file operations, preventing silent failures.

Thanks to @​jl-jonas for reporting this issue!

What's Changed

Full Changelog: takahirom/roborazzi@1.52.0...1.53.0

v1.52.0

Compare Source

Support for com.android.kotlin.multiplatform.library plugin

Even though we can use androidUnitTest in Kotlin Multiplatform Plugin, there is a way to add Android target to KMP and this might become mainstream. Roborazzi did not add the task for this plugin so we added tasks like recordRoborazziAndroidHostTest. Thank you for reporting this issue @​xVemu !

Support for KMP testRuns API

When we add testRuns in build.gradle, that enables us to control dependencies for tests in KMP, Roborazzi used to fail with Cannot add task 'clearRoborazziJvm' as a task with that name already exists.. Thank you for reporting this issue as well @​xVemu !

Fix preview tests plugin when using Bom dependencies

There are patterns that we cannot build with Roborazzi due to configuration cache issues. We addressed this issue using a new API for configuration cache. Thank you for reporting this @​igokoro !

What's Changed

Full Changelog: takahirom/roborazzi@1.51.0...1.52.0

v1.51.0

Compare Source

Add validation for Compose Preview Support users

includePrivatePreviews is an option we can set in Gradle DSL. However, there is a scenario where we cannot use it, and it appears to be a flaw. The reason why includePrivatePreviews is not utilized is that users can specify a custom tester in their code, and Roborazzi's default tester applies the option using parameters from the Gradle DSL. You can see the error message if you do not set options properly, as shown below. You can simply review and follow what the error message indicates. Thank you, @​egorikftp, for reporting this issue! Thank you, @​sergio-sastre, for your input on this issue!

  You have two options:
  1. Remove 'includePrivatePreviews = true' from generateComposePreviewRobolectricTests configuration
     and call '.includePrivatePreviews()' directly in your custom tester's testParameters() method.

  2. Set 'useScanOptionParametersInTester = true' in generateComposePreviewRobolectricTests configuration
     and check 'options.scanOptions.includePrivatePreviews' in your testParameters() implementation.

  Example for option 1:

https://redirect.github.com/takahirom/roborazzi/pull/740/files#diff-0ed97664cea9b889781317183ecffc5ab489f71f3c1ee34484ea1eeb392dd3a5R121-R167

What's Changed

Full Changelog: takahirom/roborazzi@1.50.0...1.51.0

v1.50.0

Compare Source

Fixed: Resolved Gradle task dependency errors with Android Gradle Plugin 8.12+ where GenerateComposePreviewRobolectricTestsTask output was used by compilation tasks without explicit dependencies. Thank you @​papo2608 for reporting this issue.

What's Changed

Full Changelog: takahirom/roborazzi@1.49.0...1.50.0

v1.49.0

Compare Source

ComposablePreviewScanner 0.7.0 Compatibility Update

Breaking Change - Compatibility Update Required

This release addresses a breaking compatibility issue with ComposablePreviewScanner 0.7.0 that affects users of Roborazzi's Preview support feature.

The Problem

When using ComposablePreviewScanner 0.7.0 with previous versions of Roborazzi, you'll encounter NoSuchMethodError at runtime. This happens because:

  • Method relocation: ComposablePreviewScanner 0.7.0 moved methods from AndroidPreviewScreenshotIdBuilder to provide common PreviewScreenshotIdBuilder methods for Glance and Compose Multiplatform
  • Import mismatch: Previous Roborazzi versions contain generated code with outdated import statements
  • Runtime failure: Auto-generated Roborazzi tests from Previews crash when trying to execute methods at their old locations

The Solution

This Roborazzi update replaces the old method calls and import statements with new ones compatible with ComposablePreviewScanner 0.7.0+. However, since these new method locations don't exist in ComposablePreviewScanner 0.6.x, you must update both libraries together.

⚠️ Required Action

If you use Roborazzi's Preview support, you must:

  • Update Roborazzi to this version
  • Update ComposablePreviewScanner to 0.7.0 or later

Both updates are required - updating only one will cause build or runtime errors.

Migration Steps
// Update both dependencies together
implementation "io.github.takahirom.roborazzi:roborazzi:1.49.0"
implementation "io.github.sergio-sastre.ComposablePreviewScanner:android:0.7.0" // or newer

Improved Error Detection

We've added clear build-time error messages to help you identify when this compatibility issue occurs, so you'll know exactly what needs to be updated instead of encountering cryptic runtime errors.

Common Update Scenarios

Scenario 1: Update only ComposablePreviewScanner to 0.7.0
NoSuchMethodError with old Roborazzi. Update Roborazzi to resolve.

Scenario 2: Update only Roborazzi
→ Compile-time error with clear message to update ComposablePreviewScanner ✅

Acknowledgments

Thanks to @​sergio-sastre for collaboration on resolving this compatibility challenge and maintaining the ComposablePreviewScanner library.

What's Changed

Full Changelog: takahirom/roborazzi@1.48.0...1.49.0

v1.48.0

Compare Source

Fix Preview Size Retention Bug

Fixed issue where @Preview annotation size attributes (heightDp/widthDp) incorrectly persisted between captures

Problem

Subsequent previews without explicit size would inherit dimensions from previous previews instead of using defaults.

Solution

Save and restore Robolectric qualifiers properly in captureRoboImage() to ensure preview size isolation.

Thanks to @​smuldr for reporting this issue!

Breaking Changes: Update Libraries

You can see the changes at: https://github.com/takahirom/roborazzi/actions/runs/16952566040

Overall, we are now using Kotlin 2.0.21. We don't chase the latest versions, but we want to add tests using the latest Compose Multiplatform Previews. Thank you for letting me know about this! @​sergio-sastre

What's Changed

Full Changelog: takahirom/roborazzi@1.47.0...1.48.0

v1.47.0

Compare Source

Compose Preview Tester Customization

Added Capturer interface to AndroidComposePreviewTester for customizing capture behavior (#​716). This allows setting custom
comparison thresholds and other RoborazziOptions for generated Compose preview tests.

import com.dropbox.differ.SimpleImageComparator
import com.github.takahirom.roborazzi.*

@&#8203;ExperimentalRoborazziApi
class MyCustomComposePreviewTester(
  private val defaultCapturer: AndroidComposePreviewTester.Capturer = AndroidComposePreviewTester.DefaultCapturer()
) : AndroidComposePreviewTester(
  capturer = { parameter ->
    val customOptions = parameter.roborazziOptions.copy(
      compareOptions = parameter.roborazziOptions.compareOptions.copy(
        // Set custom comparison threshold (0.0 = exact match, 1.0 = ignore differences)
        imageComparator = SimpleImageComparator(maxDistance = 0.01f)
      )
    )
    defaultCapturer.capture(
      parameter.copy(roborazziOptions = customOptions)
    )
  }
)

Fixes #​703. Thanks @​pavel163 for the issue report and @​sergio-sastre for the review!

What's Changed

New Contributors

Full Changelog: takahirom/roborazzi@1.46.1...1.47.0

v1.46.1

Compare Source

Bugfix: Fix screenshot sizing for RoborazziComposeSizeOption and Previews on Robolectric 4.15+

This release finally resolves a complex screenshot sizing issue that occurred after the Robolectric 4.15 update. Version 1.46.0 was never released as we discovered additional edge cases during the pre-release phase. This version, 1.46.1, addresses all known issues.

Initially, we migrated to using RuntimeEnvironment.setQualifiers() to configure the screen size, following the recommended approach for recent Robolectric versions. However, this change introduced new problems, especially when a widthDp and heightDp with different values were specified, or when used in combination with the device parameter in @Preview.

After extensive investigation and discussion, we've implemented a more robust solution. Roborazzi now automatically adds the correct orientation qualifier (-land or -port) based on the provided dimensions and ensures the qualifiers are applied in the correct order to avoid conflicts with other configurations. This fixes sizing for all Compose screenshot tests, making them reliable and predictable again.

Acknowledgements

A huge thank you to everyone who contributed to resolving this challenging issue! This fix would not have been possible without the collaborative effort of the community.

  • A special and massive thank you to @​sergio-sastre for their incredibly thorough testing and persistent feedback. They identified several critical edge cases, provided detailed reproductions, and patiently validated every fix, which was essential for making this solution robust.
  • Thank you to the Robolectric team, especially @​paulsowden and @​hoisie, for their invaluable guidance. Their deep insights into Robolectric's internals and clear explanation of how setQualifiers and orientation work were crucial in pointing us toward the correct and final solution.
  • Thanks to @​mannodermaus for the initial detailed bug report that kicked off this entire investigation.
  • Also, thank you to @​suhtai for providing helpful information in the early stages.

What's Changed

Full Changelog: takahirom/roborazzi@1.46.0...1.46.1

v1.45.1

Compare Source

Please refer to https://github.com/takahirom/roborazzi/releases/tag/1.45.0

v1.44.0

Compare Source

Please refer to https://github.com/takahirom/roborazzi/releases/tag/1.44.0-alpha01 to see the main changes in version 1.44.0. We are still seeking feedback on RoboComposePreviewOptions. RoboComposePreviewOptions is still experimental, and we may introduce breaking changes.

New feature: Added JUnit @Category to auto-generated tests from Compose Preview

You can now filter tests using JUnit4's RoborazziComposePreviewTestCategory. Thanks to @​hellohj for the suggestion.

Bugfix: Subdirectory screenshots are now removed when roborazzi.cleanupOldScreenshots=true

Previously, when roborazzi.cleanupOldScreenshots=true was used, subdirectory screenshots were not removed as intended. Thanks to @​pacoalface-jt for reporting the bug.

What's Changed

Full Changelog: takahirom/roborazzi@1.43.1...1.44.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/roborazzi branch from 1a11276 to b1a1e0e Compare June 1, 2025 11:47
@renovate renovate bot force-pushed the renovate/roborazzi branch from b1a1e0e to 764a768 Compare June 19, 2025 02:32
@renovate renovate bot changed the title Update roborazzi to v1.44.0 Update roborazzi to v1.45.1 Jun 19, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch 2 times, most recently from 5b9f8ea to d343ea5 Compare July 5, 2025 14:42
@renovate renovate bot changed the title Update roborazzi to v1.45.1 Update roborazzi to v1.46.1 Jul 5, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch 2 times, most recently from af98cc9 to 8026fb1 Compare August 11, 2025 12:39
@renovate renovate bot changed the title Update roborazzi to v1.46.1 Update roborazzi to v1.47.0 Aug 11, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from 8026fb1 to fb21b2f Compare August 14, 2025 10:57
@renovate renovate bot changed the title Update roborazzi to v1.47.0 Update roborazzi to v1.48.0 Aug 14, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from fb21b2f to 0988d78 Compare August 19, 2025 05:32
@renovate renovate bot changed the title Update roborazzi to v1.48.0 Update roborazzi to v1.49.0 Aug 19, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from 0988d78 to 70997f4 Compare August 23, 2025 01:57
@renovate renovate bot changed the title Update roborazzi to v1.49.0 Update roborazzi to v1.50.0 Aug 23, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from 70997f4 to e8a75f4 Compare September 25, 2025 14:31
@renovate renovate bot force-pushed the renovate/roborazzi branch 2 times, most recently from c13277b to 5f8d025 Compare October 8, 2025 05:14
@renovate renovate bot force-pushed the renovate/roborazzi branch from 5f8d025 to 6e2ec66 Compare November 4, 2025 12:47
@renovate renovate bot changed the title Update roborazzi to v1.50.0 Update roborazzi to v1.51.0 Nov 4, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from 6e2ec66 to a38187e Compare November 24, 2025 10:18
@renovate renovate bot changed the title Update roborazzi to v1.51.0 Update roborazzi Nov 24, 2025
@renovate renovate bot changed the title Update roborazzi Update roborazzi to v1.52.0 Nov 24, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from a38187e to 00b6533 Compare December 31, 2025 08:52
@renovate renovate bot changed the title Update roborazzi to v1.52.0 Update roborazzi to v1.53.0 Dec 31, 2025
@renovate renovate bot force-pushed the renovate/roborazzi branch from 00b6533 to f67236f Compare January 3, 2026 14:20
@renovate renovate bot changed the title Update roborazzi to v1.53.0 Update roborazzi to v1.54.0 Jan 3, 2026
@renovate renovate bot force-pushed the renovate/roborazzi branch from f67236f to b645423 Compare January 7, 2026 12:58
@renovate renovate bot changed the title Update roborazzi to v1.54.0 Update roborazzi to v1.55.0 Jan 7, 2026
@renovate renovate bot force-pushed the renovate/roborazzi branch from b645423 to 377819b Compare January 9, 2026 16:44
@renovate renovate bot changed the title Update roborazzi to v1.55.0 Update roborazzi to v1.56.0 Jan 9, 2026
@renovate renovate bot force-pushed the renovate/roborazzi branch from 377819b to 439e992 Compare January 24, 2026 09:07
@renovate renovate bot changed the title Update roborazzi to v1.56.0 Update roborazzi to v1.57.0 Jan 24, 2026
@renovate renovate bot force-pushed the renovate/roborazzi branch from 439e992 to ae8ff19 Compare February 2, 2026 12:51
@renovate renovate bot changed the title Update roborazzi to v1.57.0 Update roborazzi to v1.58.0 Feb 2, 2026
@renovate renovate bot force-pushed the renovate/roborazzi branch from ae8ff19 to 855ca86 Compare February 11, 2026 12:37
@renovate renovate bot changed the title Update roborazzi to v1.58.0 Update roborazzi to v1.59.0 Feb 11, 2026
@github-actions
Copy link

Caution

There was a problem with the Unit Test check. See details here.

@github-actions
Copy link

Caution

There was a problem with the release Build check. See details here or run ./gradlew :app:assemblerelease in local.

@github-actions
Copy link

Caution

There was a problem with the Detekt check. See details here or run ./gradlew detekt in local.

@github-actions
Copy link

Caution

There was a problem with the Android Lint check. See details here or run ./gradlew lint in local.

@github-actions
Copy link

Caution

There was a problem with the Ktlint check. See details here or run ./gradlew ktlintCheck in local.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants