Open a-t-0 opened 3 years ago
I wanna give it a try on this @a-t-0 @HiveMinds
Thank you for the enthousiasm! It is not quite clear to me at this point in time what the exact issue is I described here. I briefly checked and there are no literal duplicate functions in https://github.com/HiveMinds/Productivity-setup/blob/main/test/helper.sh So you are free to give it a try, however, I think it would perhaps be more effective to either look into: https://github.com/HiveMinds/Productivity-setup/issues/4 https://github.com/HiveMinds/Productivity-setup/issues/3 (Once the GitLab CI is up and running, I intend to do a significant overhaul of this repository and structure, so I can imagine small contributions in content (besides Style Guide compliance) may be overturned in that refactoring. Hence, I think quality and GitLab deployment improvements would be more effective:
https://github.com/Simple-Setup/Self-host-GitLab-Server-and-Runner-CI/issues/54 Or if you want to dive into the deep(the current bottleneck): https://github.com/Simple-Setup/Self-host-GitLab-Server-and-Runner-CI/issues/42
However, feel free to decide as you deem fun!
When an actual test result and a list of allowed results is passed, they arrive at a function that checks if the actual result is in some position in the list of allowed results. This position can be:
However, passing the actual test result is 1 argument, the list is the second argument.Assumption: one cannot pass 3 arguments to a bash function. If that assumption is valid, it is not possible to simply pass an additional argument that tells the receiving function which position should be checked. Hence I triplicated the receiving function and just call the right function directly. However that is a lot of duplicate code, which is undesirable.
Possible solutions are:
Doing either would allow me to remove 2 functions and turn them into a single function.