svengeance / Husky

Modernizing the way developers think about installers
3 stars 0 forks source link

[Feature] Extract Portions of HuskyInstaller.cs (Remove Black Box) #21

Closed svengeance closed 3 years ago

svengeance commented 3 years ago

Context

HuskyInstaller.cs as a class handles every part of of the installation process. Unfortunately, black-boxing the entire installation renders it pretty damn hard to unit test. We should consider extracting out the different facets of the install process to independent, encapsulated, unit-testable classes.

At the moment there are three identifiable portions of the Install execution that could be brought out:

Proposals

Discover which of the three above portions are available for encapsulation, do so, and add the appropriate unit tests. At the minimum we have to be able to unit/integration test dependency installations.

Pro tip: In the interest of fulfilling the "dry run" feature, we should add the capability for these dependency installations to identify - but not install - the dependencies.

Epic tip: Ensure everything is wrapped as appropriate in an interface/abstract class for mocking.

Interested Users

Husky Developers

svengeance commented 3 years ago

Updated: We should be making sure we have interfaces wrapping everything as well such that mocking becomes a possibility.

svengeance commented 3 years ago

Another food for thought here - if we can make a set of classes wrapping the execution of stages, jobs, and steps, things might turn out to be quite nice. This would provide clear separation for the behaviors that occur within each area, allow us to properly use our service provider across these boundaries, and give us a clear "init" vs "execute" phase, the boundaries of which are quite murky right now.