realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Allow executing instrumented and unit tests with the new transformer api release #7780

Closed clementetb closed 1 year ago

clementetb commented 1 year ago

This PR fixes https://github.com/realm/realm-java/issues/7771 by disabling the transformer API on Unit Test components.

There is some issue related in how the processed classes from the transformer are fed into the unit test task that does not allow the runner to resolve them.

Because Realm is not available in JVM and unit tests, disabling the Realm transformer has the same effect as applying the transformer on a Unit test, tests would only be able to use unmanaged versions of the objects.

Filed issue in google tracker: https://issuetracker.google.com/issues/270885482

The PR also fixes https://github.com/realm/realm-java/issues/7736 that prevented instrumented tests to run because of the Realm dependencies being not present in the configuration.