litmus icon indicating copy to clipboard operation
litmus copied to clipboard

chore: remove global variable for better unit testing

Open namkyu1999 opened this issue 1 year ago • 10 comments

In Litmus version 2, we already remove global variables. you can see here #3937

However, with the change of Litmus version to 3, we have a new global variable, which we need to change to a field in the struct because global variables make unit testing difficult.

Here's a global variable what we need to remove. https://github.com/litmuschaos/litmus/blob/794676f6b75e08835334fd5d675e0b0d096d5f9d/chaoscenter/graphql/server/pkg/database/mongodb/operations.go#L36

We need to find and change all the places where that global variable is used, like this Screenshot 2023-10-05 at 11 37 03 AM

Here's an example of what we did first #4136

Anyone who finds good first issues or participates in hacktoberfest can take this issue.

namkyu1999 avatar Oct 05 '23 02:10 namkyu1999

I would like to work on this. Could you assign this to me?

Ratul-Saha-003 avatar Oct 05 '23 03:10 Ratul-Saha-003

Kindly review(PR added): https://github.com/litmuschaos/litmus/pull/4219

Ratul-Saha-003 avatar Oct 06 '23 08:10 Ratul-Saha-003

Can I work on this

UncleWeeds avatar Oct 19 '23 05:10 UncleWeeds

Hey @namkyu1999 is this still open? Looks like some of the required changes are already done

srikanth-iyengar avatar Nov 11 '23 18:11 srikanth-iyengar

Do we have to eliminate global variables usage like the following? image

srikanth-iyengar avatar Nov 11 '23 18:11 srikanth-iyengar

Hey @namkyu1999 , I would like to work on this issue. Is this issue still up for grabs?

prashantrewar avatar Feb 06 '24 07:02 prashantrewar

Hey @namkyu1999 , I would like to work on this issue. Is this issue still up for grabs?

sure, go ahead!

namkyu1999 avatar Feb 06 '24 07:02 namkyu1999

/assign

prashantrewar avatar Feb 06 '24 07:02 prashantrewar

@namkyu1999, I am new to the litmus project, Could you please guide me on this issue?

prashantrewar avatar Feb 06 '24 09:02 prashantrewar

hey can you please assign me this issue? @S-ayanide @namkyu1999

pred695 avatar May 30 '24 18:05 pred695