-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to AGP 8 & Kotlin 1.9.10 #324
Conversation
Take a look at #300 for some of the issues faced there too. |
Yep, I've referenced that a few times. Only outstanding issue is for some reason mockito cannot mock a formula class for a test. Trying to resolve but haven't been able to figure out a workaround yet. |
class MyFormula : Formula<Unit, Unit, Unit>() { | ||
override fun initialState(input: Unit) = Unit | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Laimiux this test was failing due to an issue mocking MyFormula
as a StatelessFormula
:
Caused by: java.lang.reflect.MalformedParameterizedTypeException: Mismatch of count of formal and actual type arguments in constructor of com.instacart.formula.StatelessFormula$implementation$1: 0 formal argument(s) 2 actual argument(s)
at java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(Unknown Source)
at java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(Unknown Source)
at java.base/sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(Unknown Source)
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(Unknown Source)
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Unknown Source)
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(Unknown Source)
at java.base/sun.reflect.generics.repository.FieldRepository.computeGenericType(Unknown Source)
at java.base/sun.reflect.generics.repository.FieldRepository.getGenericType(Unknown Source)
at java.base/java.lang.reflect.Field.getGenericType(Unknown Source)
at net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection$ForLoadedFieldType.resolve(TypeDescription.java:6685)
at net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection.accept(TypeDescription.java:6297)
at net.bytebuddy.description.field.FieldDescription$AbstractBase.asToken(FieldDescription.java:200)
at net.bytebuddy.description.field.FieldDescription$AbstractBase.asToken(FieldDescription.java:123)
at net.bytebuddy.description.field.FieldList$AbstractBase.asTokenList(FieldList.java:64)
at net.bytebuddy.dynamic.scaffold.InstrumentedType$Factory$Default$1.represent(InstrumentedType.java:436)
at net.bytebuddy.ByteBuddy.redefine(ByteBuddy.java:886)
at net.bytebuddy.ByteBuddy.redefine(ByteBuddy.java:861)
at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.transform(InlineBytecodeGenerator.java:390)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(Unknown Source)
at java.instrument/sun.instrument.TransformerManager.transform(Unknown Source)
at java.instrument/sun.instrument.InstrumentationImpl.transform(Unknown Source)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(Unknown Source)
at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.triggerRetransformation(InlineBytecodeGenerator.java:281)
... 58 more
I changed MyFormula
to extend Formula
as a workaround which seems ok based on what the actual test is trying to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this test was added to ensure that mockFormula
would continue to work in our codebase.
JaCoCo Code Coverage 78.89% ✅
Generated by 🚫 Danger |
.github/workflows/build-workflow.yml
Outdated
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be java 18?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated.
* Upgrade to AGP 8 & Kotlin 1.9.20 * Use java 17 * Update jacoco version * Fix namespace in stopwatch * Update compose version & remove namespace from manifest files * Fix compilation errors, update mockito * Update compile sdk to 33 * Update compile sdk to 34 * Update to latest versions of mockito * Fix for mockito test * Fix test compilation error * Fix test compilation error * Revert change with R namespace change, update robolectric * Use kotlin 1.9.10 to match IC App * Revert to compose 1.5.3 which supports kotlin 1.9.10 * Use jdk 18 * Fix mockito. * Use java 18. --------- Co-authored-by: Laimonas Turauskas <[email protected]>
build.gradle.kts