microcks icon indicating copy to clipboard operation
microcks copied to clipboard

Adding unit tests for microcks-util

Open Harsh4902 opened this issue 1 year ago • 25 comments

Description

  • [x] SchemaMap
  • [x] JsonSchemValidatorQuery
  • [x] XmlErrorHandler
  • [x] XmlSchemaURLResolver
  • [x] XmlSchemaValidator
  • [x] XmlUtil

Related issue(s)

  • Resolves #1193

Harsh4902 avatar Jun 14 '24 05:06 Harsh4902

👋 @Harsh4902

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

github-actions[bot] avatar Jun 14 '24 05:06 github-actions[bot]

@lbroudoux with this PR, I am planning to add unit tests for all the classes which I have mentioned in description. Please check the unit test which I have written for SchemaMap and review it.

Harsh4902 avatar Jun 14 '24 05:06 Harsh4902

Awesome! Can you fix the DCO check by signing the commits please? This is a prequisites for CNCF projects.

lbroudoux avatar Jun 14 '24 10:06 lbroudoux

@lbroudoux can we use mockito in unit test to mock some functionality?

Harsh4902 avatar Jun 18 '24 15:06 Harsh4902

Yes. Mockito is already available on webapp module. Just be sure to align the versions used.

lbroudoux avatar Jun 18 '24 17:06 lbroudoux

This looks super promising! Thanks a lot for this contribution! Eager to merge it!

lbroudoux avatar Jun 19 '24 12:06 lbroudoux

@lbroudoux Thank you. I will make changes as per your suggestions.

Harsh4902 avatar Jun 19 '24 14:06 Harsh4902

All good for the headers!

lbroudoux avatar Jun 19 '24 15:06 lbroudoux

@lbroudoux created unit tests for all the classes of microcks-util module. Now you can merge this branch.

Harsh4902 avatar Jun 23 '24 18:06 Harsh4902

It looks like the code is not formatted correctly. Can you run mvn spotless:apply on the module and then push again?

lbroudoux avatar Jun 24 '24 08:06 lbroudoux

@lbroudoux I have corrected it.

Harsh4902 avatar Jun 24 '24 09:06 Harsh4902

It looks like some tests are. failing here: https://github.com/microcks/microcks/actions/runs/9642663551/job/26599414197?pr=1210#step:4:1463 Could you have a look at it?

lbroudoux avatar Jun 24 '24 12:06 lbroudoux

@lbroudoux I have used mvn test inside microcks-util and all tests are running perfectly on my machine. you can see output here: Screenshot 2024-06-25 at 9 47 42 AM

Harsh4902 avatar Jun 25 '24 04:06 Harsh4902

I think the error is due to the version of the maven-surefire-plugin that is picked by the build. On my machine, it also works with a surefire version of 3.0. I'll try to fix this in the pom.xml.

lbroudoux avatar Jun 25 '24 07:06 lbroudoux

Hum I think we can keep this one open as It's shouldn't be that hard to fix. Give me a few minutes to figure this out.

lbroudoux avatar Jun 25 '24 07:06 lbroudoux

Hum I think we can keep this one open as It's shouldn't be that hard to fix. Give me a few minutes to figure this out.

Yeah, sure.

Harsh4902 avatar Jun 25 '24 07:06 Harsh4902

Ok. I reproduce it on my machine. It's actually because the build is picking maven-surefire-plugin 2.12.4. Don't know why at the moment but investigating.

lbroudoux avatar Jun 25 '24 07:06 lbroudoux

I think I have the fix. I have re-opened #1151 and will put the fix here. Please rebase your branch and re-push once it is commited.

lbroudoux avatar Jun 25 '24 07:06 lbroudoux

It has been pushed

lbroudoux avatar Jun 25 '24 07:06 lbroudoux

I have rebased it.

Harsh4902 avatar Jun 25 '24 07:06 Harsh4902

Your tests are now ok, but it looks like, as a side effect, some others are failing... I don't succeed in reproducing this at the moment.

lbroudoux avatar Jun 25 '24 07:06 lbroudoux

I really don't see the cause of failure here... Could you confirm it still works on your side or not? If it works maybe just put additional logs in the tests at failure locations so that we can try to guess what can go wrong..

lbroudoux avatar Jun 25 '24 08:06 lbroudoux

@lbroudoux I am working on failing tests from my side.

Harsh4902 avatar Jun 25 '24 08:06 Harsh4902

Do you have the same result than GitHub Action build?

lbroudoux avatar Jun 25 '24 08:06 lbroudoux

Do you have the same result than GitHub Action build?

No, it's still working fine on my machine but, I am trying to find the issue in github action.

Harsh4902 avatar Jun 25 '24 08:06 Harsh4902

Hey @Harsh4902 Thanks for the latest update. It looks like everything is now working fine on my side!! I think we can proceed to merge.

lbroudoux avatar Jul 23 '24 13:07 lbroudoux

🎉 @Harsh4902

You are now a Microcks community contributor! 💖

Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Kudos and please keep going, we need you 🙌

github-actions[bot] avatar Jul 23 '24 13:07 github-actions[bot]

@lbroudoux Thank you for merging this PR. I am looking forward to contribute more in microcks.

Harsh4902 avatar Jul 23 '24 15:07 Harsh4902