ApprovalTests.Java icon indicating copy to clipboard operation
ApprovalTests.Java copied to clipboard

Test runner for Android includes app's version name and version code in file names

Open ragunathjawahar opened this issue 3 years ago • 0 comments

In recent versions of Android projects (Android Gradle Plugin maybe?), the filenames contain the name of the app, version name, version code, and the build variant. This becomes problematic because the tests will start failing once the version name, version code changes or if the developer switches the build variant.

MyTest.testFunction$AppName_1_0_0_1_build_variant.received.txt

As a work around, I use a custom namer that strips this information off the file name. Things are good with the custom namer. However, when it comes to combination approvals, the API doesn't allow me to specify a namer. I tried using the Options API, but I am unable to get a namer in.

What is the best way to achieve this?

ragunathjawahar avatar Jun 07 '22 08:06 ragunathjawahar