hello community, there is an error in the Address Service tests
I have been updating the Region Service Test and on formating the changes I ran into an error which belongs to the Address Service tests which is related to [hibernate(22 Jan 2025 00:54:42 -- ERROR -- HHH000315: Exception executing batch [java.sql. - Pastebin.com)
cc: @segujja_joseph
let me take look at it and get back to you shortly
hey @Agaba_Derrick_Junior i have looked into the logs and it indicates the test class or testcase itself has no problem it is to do with how the data is being loaded in the data base hance javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException:
this is an test evironment setup issue; failing to auto genrate an id for the object being persisted in the data base. Why do i say so;
- Oganisation as a table has no dummy data pre-loaded in the data base so creating a new element should be fine
- ID field is autogenerated so that the element should have an id generated upon its creation
- Lastly there is a cleanup before and after to ensure no leakages in the data base after every test
with this i think we can rule out the test having an issue
i too have been facing the same challenge each time i try to push my work the CI has been Having a lot of javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException:
especially with contrain violation of fields, already existing element with ID:… and so on
am still working around it to see what the problem might be
@mherman22 @Moses_Mutesasira @caseyi
@Agaba_Derrick_Junior could you try to clone the repository again and push your changes with that and make sure its up to date we see if you get the same errors
@segujja_joseph Recloning the repo aint ` solution, the failing Tests are already merged in the code base, the best solution would be for us to make a follow-up PR with changes that fix our bug
1 Like
have you looked into @mherman22 Pr
i think you will find it resourceful
1 Like
yeah sure waiting upon its merging
cc @mherman22 @Moses_Mutesasira
@Agaba_Derrick_Junior
though there’s one catch it flushes out all the dumy data of those particular tables in the data base
that is to say if you were making test relying on such already pre-existing data, you might wanna create wanna create new entries for specific objects especial when the service in question is dependant on such entries
1 Like