-
-
Notifications
You must be signed in to change notification settings - Fork 388
Remove duplication in testcode #3315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bc9305d
to
d6241ea
Compare
Move ghcide-test-utils to a top-level directory. Extrace ghcide-tests into its own package, s.t. it can depend on hls-test-utils for defining tests. In particular, it should use the same infrastructure for ignoring tests.
d6241ea
to
2ff3b6c
Compare
Would this also unblock #2979 ? |
Not yet, but might be helpful to further simplify the dependency graph. I think, we might want to design the dependency graph we want and then try to work towards it. |
I don't want to lose |
Sure, I will create a component diagram of the status quo, ideally in something that we can edit as we improve things, so that we can decide on a better course of action. |
I created some graphs, but they aren't as helpful as hoped. We can merge hls-test-utils with ghcide-test-utils and merge it into ghcide as sub-libraries. |
Duplication is not the worst code smell, in some cases it's well justified. I wonder if that's the case here. If the solution is worse than the problem, is it worth fixing it at all?
|
Maintenance costs are currently a real thing in this stage of HLS's life, code duplication, especially unnecessary, increases maintenance burden, slightly, in my opinion. In this case, the main benefit is a bit of untangling of dependencies. What is so bad about not having
This PR actually cleans this mess up, assuming you'd agree that this is messy. |
It's another thing to learn and remember when contributing to HLS. Most consumers, whether it's users or CI systems (think Nix), expect
The extra entries in |
Sure, I will move the code, and we will take a look on how it feels. EDIT: I've had a second idea. Since the only thing ghcide-tests take from hls-test-utils are the Advantage:
Disadvantage:
|
Much beter |
Last question, maintenance of this new package in the hls repository or should I just create a package and we maintain it in another repository. I am inclined to do the latter to not increase the CI load for this repository. That or we plan to increase our CI capabilities. |
I am in favour of sticking to a monorepo for as long as possible. What impact do you expect adding this new package will have on CI? |
Probably not a lot, but the CI is already stretched to its limits, I feel. I don't think we know how much caching space we need per GHC version, and we only have 10GB for all supported GHC versions, adding more libs will just increase the size. In other words, it is unlikely to be noticeably worse, but the CI seems overloaded at the moment. |
I don't intend to follow up on this in the foreseeable future. Closing it. |
Extracts ghcide-tests s.t. we can add hls-test-utils as a dependency of ghcide-tests.
Did not work before with this error
So, we extract the package and reduce some of the code duplication.