3 ms·
This looks very similar to how I test my configuration management tool Holo: I just run the compiled binary in a chroot and compare its output and the resulting
by majewsky 10y ago
This looks very similar to how I test my configuration management tool Holo: I just run the compiled binary in a chroot and compare its output and the resulting filesystem tree to the recorded expectation. [1]
So no unit tests at all. I think that unit tests work very well for pure functions, but their utility decreases the more side effects your code has. Also, unit tests usually just add confusion when the unit tested is really an internal implementation detail, rather than refering to some object in the application's or library's external domain model.
[1] https://github.com/holocm/holo/tree/master/test https://github.com/holocm/holo/tree/master/test for the core parts
- GauntletWizard 10y agoI personally see that as a unit test; Plenty of unit tests use real files on the filesystem in their mocks, you're hermetically sealed from the rest of the system, how is it not a unit test? I'm just arguing vocabulary, though. There seems to be a spectrum, pure unit tests on one side, then integration tests, with Canaries way off to the other side.
- LukeShu 10y agoBecause it is testing the functionality of the entire program (the single executable), not individual component units (functions).
- nwmcsween 10y agoWhich is the reason most conf mgt tools are broken due to not understanding the domain and in this case resolving a graph.