impact-graph icon indicating copy to clipboard operation
impact-graph copied to clipboard

CI/CD duration time has increased from 15 min to 30 min because of admin js test cases

Open mohammadranjbarz opened this issue 10 months ago • 1 comments

We should find a way to run admin test cases parallel ( as they don't have any DB call or something it would not make a problem to make them parallel) to decrease CI/CD time. we have about 1.5 k test cases for admin permissions to cover all roles and permissions)

@jainkrati can you specify priority for this issue?

mohammadranjbarz avatar Apr 15 '24 09:04 mohammadranjbarz

Hey @CarlosQ96, here is what I mentioned on the call, I noticed this beforeEach is running in root block which adding more time while running all the test cases since it's running before every test case https://github.com/Giveth/impact-graph/blob/e821acb7b0dbdbb5056d652584e79ca5ed29b127/src/repositories/previousRoundRankRepository.test.ts#L47-L54

Meriem-BM avatar Apr 22 '24 15:04 Meriem-BM

Hey @CarlosQ96, here is what I mentioned on the call, I noticed this beforeEach is running in root block which adding more time while running all the test cases since it's running before every test case

https://github.com/Giveth/impact-graph/blob/e821acb7b0dbdbb5056d652584e79ca5ed29b127/src/repositories/previousRoundRankRepository.test.ts#L47-L54

Thanks @Meriem-BM , we should test it, because I know we need these stuff for some test cases and removing them would cause failing some test cases and also it's not related to the admin js test cases time, we can following up this in another issue

mohammadranjbarz avatar May 07 '24 12:05 mohammadranjbarz

Okay, so it would be better to exclude permission test cases from these beforeEach at least as they don't require any DB interactions, I'll look up a way for that.

Meriem-BM avatar May 07 '24 12:05 Meriem-BM

Thanks @Meriem-BM , Please let me know when you started and had a draft PR

mohammadranjbarz avatar May 08 '24 05:05 mohammadranjbarz

@Meriem-BM pls work on this with guidance from @mohammadranjbarz

jainkrati avatar May 08 '24 12:05 jainkrati

@mohammadranjbarz, what I did here is modify the global beforeEach to exclude the permissions test case. This is done by preventing the code inside beforeEach from executing when the test case title matches the permissions test cases.

Meriem-BM avatar May 19 '24 19:05 Meriem-BM

@mohammadranjbarz, what I did here is modify the global beforeEach to exclude the permissions test case. This is done by preventing the code inside beforeEach from executing when the test case title matches the permissions test cases.

What a creative solution, well done

mohammadranjbarz avatar May 20 '24 12:05 mohammadranjbarz

If it doesn't need to test from QA side please move it to the column related to its status @mohammadranjbarz

maryjaf avatar May 27 '24 10:05 maryjaf

@maryjaf I approve that it's working, and as it's on the production I move this to Done JFYI @jainkrati

mohammadranjbarz avatar May 27 '24 11:05 mohammadranjbarz