FasterXML / jackson-module-kotlin

Module that adds support for serialization/deserialization of Kotlin (http://kotlinlang.org) classes and data classes.
Apache License 2.0
1.12k stars 175 forks source link

Kotlin module 3.0 (master) fails 11 unit test #724

Closed cowtowncoder closed 9 months ago

cowtowncoder commented 9 months ago

After 2.16.0 release (not completed), I noticed that there seems to be some regression in master (3.0.0-SNAPSHOT) for this module. One test may be due to fixing of an issue; and 9 failures have same symptoms so it might be due to just 2 root causes. Still, would be great to get green build.

Locally I get following failures:


[ERROR] Failures: 
[ERROR]   OwnerRequestTest.testDeserHit340:51 GitHub #340 has been fixed!
[ERROR] Errors: 
[ERROR]   ParameterNameTests.findingPrimaryConstructor:370 » InvalidDefinition Conflicting property-based creators: already had explicitly marked creator [constructor for `tools.jackson.module.kotlin.test.ParameterNameTests$HasSameParamNameConstructor` (1 arg), annotations: [null], encountered another: [constructor for `tools.jackson.module.kotlin.test.ParameterNameTests$HasSameParamNameConstructor` (1 arg), annotations: [null]
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); byte offset: #UNKNOWN]
[ERROR]   TestCasesFromSlack1.testCzarSpringThing1:69 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestCasesFromSlack2.testCzarSpringThing2:67 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithub15.testClassWithEnumsNeedingConstruction:40 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithub15.testEnumConstructorWithParm:9 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithub15.testNormEnumWithoutParam:16 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithub158.testEnumSerDeser:34 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithub179.embeddedListOfEnums:52 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithub181.testReflectionExceptionOnDelegatedMap:30 » IndexOutOfBounds Index: 1, Size: 1
[ERROR]   TestGithubDatabind1328.testPolymorphicWithEnum:56 » IndexOutOfBounds Index: 1, Size: 1
[INFO] 
[ERROR] Tests run: 262, Failures: 1, Errors: 10, Skipped: 6

``
k163377 commented 9 months ago

Has this problem been resolved? https://github.com/FasterXML/jackson-databind/issues/4019

I did not fix the test failure on main as it looked like it should not be changed until a policy on this issue was in place.

cowtowncoder commented 9 months ago

@k163377 Ok with some help I can hopefully address that databind issue. Is this causing all of those IndexOutOfBoundsExceptions?

But it looks like the one different "failure" was instead something being fixed, and test that verifies previously faulty behavior is now indicating "failure" (so that test can be changed).

k163377 commented 9 months ago

Because some tests did not succeed, I did not consider the other failures to be a priority to fix. For this reason, I did not examine the other issues in as much detail.

Do they need to be prioritized? If so, I will make it a priority.

cowtowncoder commented 9 months ago

@k163377 It is up to you -- I can see your point in that it makes most sense to have all tests pass; even a single failure is distracting. Let's try to solve the linked-to issue first, then.

k163377 commented 9 months ago

@cowtowncoder As commented below, it seems that one cause is a bug in the findCreatorAnnotation of the master. https://github.com/FasterXML/jackson-databind/issues/4019#issuecomment-1817771897

Considering that hasCreatorAnnotation is deprecated at this time to begin with, I have submitted a PR to implement findCreatorAnnotation for 2.x.

727

Could you please review it?

k163377 commented 9 months ago

Several other fixes have been made and the master branch is now successfully tested. https://github.com/FasterXML/jackson-module-kotlin/actions/runs/6929567833

cowtowncoder commented 9 months ago

Thank you @k163377 !