Skip to content

[Feature Request] Bazel Support #63

Description

@bohregard

The company that I work for is using Bazel as the build tool for our application and we are considering using Roborazzi for snapshot testing in the future. We've done some internal testing and it looks like the tool doesn't need the Gradle plugin to successfully run since you can pass in the environment flag. For instance in Gradle we could do:

tasks.withType<Test> {
  doFirst {
    systemProperties["roborazzi.test.record"] = "true"
  }
}

All tests that incorporate Roborazzi will then output the snapshots. (Obviously they will always do that but that's ok for us since that's our desired output).

Ideally we would build a custom rule on android_local_test (something like snapshot_local_test) where we pass in the custom environment variable for Roborazzi.

The challenge is then Bazel outputs everything into a build output directory (https://bazel.build/remote/output-directories). Is it possible to bake support for moving the snapshot tests to the root src directory after a successful rule has executed?

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