# Failing intergration Tests

**URL:** <https://talk.openelis-global.org/t/failing-intergration-tests/1070>\
**Category:** Community\
**Created:** [January 21, 2025, 10:15pm UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070 "2025-01-21T22:15:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [January 21, 2025, 10:15pm UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/1 "2025-01-21T22:15:26Z")

</div>

hello community, there is an error in the Address Service tests  
I have been updating the [Region Service Test](https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/1235) and on formating the changes I ran into an [error](https://pastebin.com/UZKirMD7) 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](https://pastebin.com/qQcTuj4H))

 ![Screenshot from 2025-01-22 01-10-41](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/original/1X/c7a7f5da4f319ca09f272ae5694b69d7c1fbde9f.png)  
 ![Screenshot from 2025-01-22 01-12-21](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/original/1X/799508df12e1998f6aa1d20a41f191ece2320a5e.png)

cc: @segujja_joseph

---

<div class="post-metadata">

**Author:** ![segujja\_joseph](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/segujja_joseph/32/78_2.png) [@segujja\_joseph](https://talk.openelis-global.org/u/segujja_joseph)\
**Post date:** [January 22, 2025, 10:50am UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/2 "2025-01-22T10:50:46Z")

</div>

let me take look at it and get back to you shortly

---

<div class="post-metadata">

**Author:** ![segujja\_joseph](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/segujja_joseph/32/78_2.png) [@segujja\_joseph](https://talk.openelis-global.org/u/segujja_joseph)\
**Post date:** [January 24, 2025, 7:42am UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/3 "2025-01-24T07:42:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![segujja\_joseph](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/segujja_joseph/32/78_2.png) [@segujja\_joseph](https://talk.openelis-global.org/u/segujja_joseph)\
**Post date:** [January 24, 2025, 7:45am UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/4 "2025-01-24T07:45:56Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [January 24, 2025, 4:59pm UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/5 "2025-01-24T16:59:11Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![segujja\_joseph](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/segujja_joseph/32/78_2.png) [@segujja\_joseph](https://talk.openelis-global.org/u/segujja_joseph)\
**Post date:** [January 28, 2025, 8:06am UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/6 "2025-01-28T08:06:08Z")

</div>

have you looked into @mherman22 Pr

> <https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/a2e02798d0e1f96606ed04ae1eae50bca3248b58/src/test/java/org/openelisglobal/BaseWebContextSensitiveTest.java>

i think you will find it resourceful

---

<div class="post-metadata">

**Author:** ![Agaba\_Derrick\_Junior](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/agaba_derrick_junior/32/503_2.png) [@Agaba\_Derrick\_Junior](https://talk.openelis-global.org/u/Agaba_Derrick_Junior)\
**Post date:** [January 28, 2025, 8:09am UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/7 "2025-01-28T08:09:51Z")

</div>

yeah sure waiting upon its merging  
cc @mherman22@Moses_Mutesasira

---

<div class="post-metadata">

**Author:** ![segujja\_joseph](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/segujja_joseph/32/78_2.png) [@segujja\_joseph](https://talk.openelis-global.org/u/segujja_joseph)\
**Post date:** [January 28, 2025, 9:17am UTC](https://talk.openelis-global.org/t/failing-intergration-tests/1070/8 "2025-01-28T09:17:47Z")

</div>

@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
