Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: takahirom/roborazzi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c9c82d4b8e32d3b5fd942d3d96feb465ab356e66
Choose a base ref
..
head repository: takahirom/roborazzi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e752ae5b84d65ab95d29071122483ae974821c89
Choose a head ref
10 changes: 5 additions & 5 deletions .github/workflows/CompareScreenshot.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout base branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.base_ref }}
- name: Set up JDK 17
@@ -58,15 +58,15 @@ jobs:
run: |
./gradlew compareRoborazziDebug compareRoborazziDesktop compareRoborazziJvm compareRoborazziIosArm64 compareRoborazziIosX64 --stacktrace --info
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-diff
path: |
**/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-diff-reports
@@ -75,7 +75,7 @@ jobs:
**/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-diff-test-results
@@ -88,7 +88,7 @@ jobs:
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: pr
path: pr/
6 changes: 3 additions & 3 deletions .github/workflows/StoreScreenshot.yml
Original file line number Diff line number Diff line change
@@ -41,15 +41,15 @@ jobs:
cd ..
./gradlew recordRoborazziDebug recordRoborazziDesktop recordRoborazziJvm recordRoborazziIosX64 recordRoborazziIosArm64 --stacktrace
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot
path: |
**/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-reports
@@ -58,7 +58,7 @@ jobs:
**/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-test-results
2 changes: 1 addition & 1 deletion .github/workflows/build-plugin.yaml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ jobs:
run: |
./gradlew roborazzi-idea-plugin:build --stacktrace
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: roborazzi-plugin-jar
6 changes: 3 additions & 3 deletions .github/workflows/compare-verify-test.yaml
Original file line number Diff line number Diff line change
@@ -64,21 +64,21 @@ jobs:
echo "Roborazzi should verify changes"
exit 1
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-diff
path: sample-android/build/outputs/roborazzi
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-diff-reports
path: sample-android/build/reports
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: screenshot-diff-test-results
66 changes: 66 additions & 0 deletions .github/workflows/dependency-diff-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Dependency Diff Comment

on:
workflow_run:
workflows: ["Dependency Diff Report"]
types:
- completed

jobs:
comment-dependency-diff:
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest

permissions:
actions: read
contents: write
pull-requests: write
env:
LOG_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}
steps:
- name: Download PR number artifact
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2
with:
name: pr
run_id: ${{ github.event.workflow_run.id }}

- name: Get pull request number
id: get-pr-number
run: |
PR_NUMBER=$(cat NR)
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
- name: Download dependency diff artifacts
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2
with:
name: dependency-diff
run_id: ${{ github.event.workflow_run.id }}
path: dependency-diff

- name: Process dependency diff reports
id: process-diff
run: |
report_library_exists_diff=$(grep 'exists-diff=' dependency-diff/report-library.txt | cut -d'=' -f2)
report_plugin_exists_diff=$(grep 'exists-diff=' dependency-diff/report-plugin.txt | cut -d'=' -f2)
echo "report_library_exists_diff=$report_library_exists_diff" >> $GITHUB_ENV
echo "report_plugin_exists_diff=$report_plugin_exists_diff" >> $GITHUB_ENV
- name: Comment on PR for library
if: env.report_library_exists_diff == 'true' || failure()
uses: yumemi-inc/comment-pull-request@v1
with:
pull-request-number: ${{ env.PR_NUMBER }}
comment: ':warning: There are differences in library dependencies. See details [here](${{ env.LOG_URL }}).'
comment-if-failure: ':exclamation: Report workflow failed. See details [here](${{ env.LOG_URL }}).'

- name: Comment on PR for plugin
if: env.report_plugin_exists_diff == 'true' || failure()
uses: yumemi-inc/comment-pull-request@v1
with:
pull-request-number: ${{ env.PR_NUMBER }}
comment: ':warning: There are differences in plugin dependencies. See details [here](${{ env.LOG_URL }}).'
comment-if-failure: ':exclamation: Report workflow failed. See details [here](${{ env.LOG_URL }}).'
62 changes: 62 additions & 0 deletions .github/workflows/dependency-diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Dependency Diff Report

on: pull_request

jobs:
report:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
distribution: 'zulu'
java-version: 19
- name: Generate dependency diff report for library
uses: yumemi-inc/gradle-dependency-diff-report@v2
id: report-library
with:
configuration: 'releaseRuntimeClasspath'
modules: |
roborazzi-compose-ios|commonMainImplementationDependenciesMetadata
roborazzi-compose-desktop|commonMainImplementationDependenciesMetadata
roborazzi
roborazzi-compose
roborazzi-compose-preview-scanner-support
- name: Save report-library outputs
run: |
mkdir -p outputs
echo "exists-diff=${{ steps.report-library.outputs.exists-diff }}" > outputs/report-library.txt
- name: Generate dependency diff report for plugin
uses: yumemi-inc/gradle-dependency-diff-report@v2
id: report-plugin
with:
modules: 'roborazzi-gradle-plugin'
configuration: 'runtimeClasspath'
project-dir: 'include-build'

- name: Save report-plugin outputs
run: |
echo "exists-diff=${{ steps.report-plugin.outputs.exists-diff }}" > outputs/report-plugin.txt
- name: Save PR number
if: ${{ github.event_name == 'pull_request' }}
run: |
mkdir -p pr
echo ${{ github.event.number }} > pr/NR
- name: Upload Dependency Diff Artifacts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: dependency-diff
path: outputs/
retention-days: 30

- name: Upload PR Number Artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: pr
path: pr/
retention-days: 30
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ jobs:
docker-version: ${{ env.DOCKER_VERSION }}

- name: Upload documentation
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
with:
name: docs
path: |
4 changes: 2 additions & 2 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
@@ -29,14 +29,14 @@ jobs:
cd include-build
./gradlew roborazzi-gradle-plugin:check --stacktrace
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: test-reports
path: include-build/roborazzi-gradle-plugin/build/reports
retention-days: 30

- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: test-test-results
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ jobs:
cd include-build
./gradlew test jvmTest --stacktrace -x testReleaseUnitTest
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4
if: ${{ always() }}
with:
name: tests-reports
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -957,6 +957,26 @@ data class RoborazziOptions(
}
```
#### Image comparator custom settings
When comparing images, you may encounter differences due to minor changes related to antialiasing. You can use the options below to avoid this.
```kotlin
@get:Rule
val roborazziRule = RoborazziRule(
options = RoborazziRule.Options(
roborazziOptions = RoborazziOptions(
compareOptions = RoborazziOptions.CompareOptions(
changeThreshold = 0.01, // For 1% accepted difference
imageComparator = SimpleImageComparator(
maxDistance = 0.007F, // 0.001F is default value from Differ
vShift = 2, // Increasing the shift can help resolve antialiasing issues
hShift = 2 // Increasing the shift can help resolve antialiasing issues
)
)
)
)
)
```
### Dump mode
If you are having trouble debugging your test, try Dump mode as follows.
20 changes: 20 additions & 0 deletions docs/topics/how_to_use.md
Original file line number Diff line number Diff line change
@@ -634,6 +634,26 @@ data class RoborazziOptions(
}
```
#### Image comparator custom settings
When comparing images, you may encounter differences due to minor changes related to antialiasing. You can use the options below to avoid this.
```kotlin
@get:Rule
val roborazziRule = RoborazziRule(
options = RoborazziRule.Options(
roborazziOptions = RoborazziOptions(
compareOptions = RoborazziOptions.CompareOptions(
changeThreshold = 0.01, // For 1% accepted difference
imageComparator = SimpleImageComparator(
maxDistance = 0.007F, // 0.001F is default value from Differ
vShift = 2, // Increasing the shift can help resolve antialiasing issues
hShift = 2 // Increasing the shift can help resolve antialiasing issues
)
)
)
)
)
```
### Dump mode
If you are having trouble debugging your test, try Dump mode as follows.
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -15,12 +15,12 @@ roborazzi-for-replacing-by-include-build = "1.0.0"
androidx-activity = "1.7.2"
androidx-appcompat = "1.7.0"
androidx-compose-material = "1.6.8"
androidx-compose-material3 = "1.2.1"
androidx-compose-material3 = "1.3.0"
androidx-compose-foundation = "1.6.8"
androidx-compose-runtime = "1.6.8"
androidx-compose-ui = "1.7.4"
androidx-compose-ui = "1.7.5"
androidx-compose-ui-test = "1.6.8"
androidx-compose-ui-test-junit4 = "1.4.0"
androidx-compose-ui-test-junit4 = "1.7.4"
androidx-compose-ui-test-manifest = "1.4.0"
androidx-compose-ui-tooling = "1.4.0"
androidx-compose-ui-tooling-preview = "1.4.0"
@@ -41,7 +41,7 @@ squareup-okhttp = "5.0.0-alpha.11"
kotlinx-io = "0.3.3"
webjar-material-design-icons = "4.0.0"
webjar-materialize = "1.0.0"
webjars-locator-lite = "0.0.4"
webjars-locator-lite = "0.0.6"

composable-preview-scanner = "0.3.2"

28 changes: 17 additions & 11 deletions roborazzi-idea-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
plugins {
id("java")
id("org.jetbrains.kotlin.jvm")
id("org.jetbrains.intellij") version "1.17.2"
id("org.jetbrains.intellij.platform") version "2.1.0"
}

group = "io.github.takahirom.roborazzi"
version = "1.8.0"
version = "1.9.0"

repositories {
mavenCentral()
}

// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
updateSinceUntilBuild = false
repositories {
mavenCentral()

intellijPlatform {
defaultRepositories()
}
}

version.set("2023.2.5")
type.set("IC") // Target IDE Platform
dependencies {
intellijPlatform {
intellijIdeaCommunity("2024.2.2", false)
bundledPlugin("com.intellij.java")
bundledPlugin("org.jetbrains.kotlin")
bundledPlugin("com.intellij.gradle")

plugins.set(listOf(
"java",
"Kotlin",
"com.intellij.gradle",
))
instrumentationTools()
}
}

tasks {
Loading