Skip to content
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

Test refactoring: use "@JacksonTestFailureExpected" from jackson-core test-jar #4910

Merged

Conversation

cowtowncoder
Copy link
Member

So: convert existing "tofix" tests to use shared version of annotations.

@cowtowncoder
Copy link
Member Author

cc @JooHyukKim : second part of refactoring, to use shared definitions. Should be possible to do for other repos too. What is needed:

  • Add dependency in pom.xml:
    <dependency>
      <groupId>tools.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>${jackson.version.core}</version>
      <classifier>tests</classifier>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  • No need to add module dependency (yet) -- for some reason module metadata not included

But with that should be able to use:

  • tools.jackson.core.testutil.JacksonTestUtilBase as base class (or via static includes) -- like DatabindTestUtil does
  • tools.jackson.core.testutil.failure.JacksonTestFailureExpected annotation

to replace current in-project copies of functionality.

@cowtowncoder cowtowncoder merged commit b7ce302 into master Jan 16, 2025
6 checks passed
@cowtowncoder cowtowncoder deleted the tatu/3.0/use-shared-expect-fail-test-annotation branch January 16, 2025 02:44
@cowtowncoder
Copy link
Member Author

cc @JooHyukKim : second part of refactoring, to use shared definitions. Should be possible to do for other repos too. What is needed:

  • Add dependency in pom.xml:
    <dependency>
      <groupId>tools.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>${jackson.version.core}</version>
      <classifier>tests</classifier>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  • No need to add module dependency (yet) -- for some reason module metadata not included

But with that should be able to use:

  • tools.jackson.core.testutil.JacksonTestUtilBase as base class (or via static includes) -- like DatabindTestUtil does
  • tools.jackson.core.testutil.failure.JacksonTestFailureExpected annotation

to replace current in-project copies of functionality.

@JooHyukKim
Copy link
Member

Okay.. 1. add jackson-core dependency and 2.do the migration.
Should we be applying to master branch only? @cowtowncoder

@cowtowncoder
Copy link
Member Author

@JooHyukKim I already did this for jackson-databind here. But unfortunately my second attempt, with XML module:

FasterXML/jackson-dataformat-xml#707

does not seem to work, so I am not sure if we can make things work... so let's keep this on hold for now.

@JooHyukKim
Copy link
Member

does not seem to work, so I am not sure if we can make things work... so let's keep this on hold for now.

Yeah... awe are almost done with migration so this can wait 👌🏽

This task may end up taking so much resources cause we can't really test light weight.

I was thinking maybe PJ could help(intentionally not tagging) but holding off for now seems reasonable

@cowtowncoder
Copy link
Member Author

@JooHyukKim right. I think it has something to do with Maven not being able to get qualifier dependency right (logical artifact id is jackson-core for both jars).
Or it could be due to test-jar missing module-info.class (cannot get it included no matter what.

One possibility would be to actually create repo like jackson-test-base and publish actual stand-alone jar. Need to think about this a bit.
(theoretically could alternatively make jackson-core multi-project Maven thing but... I don't like that idea).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants