FireMotD icon indicating copy to clipboard operation
FireMotD copied to clipboard

Unit testing

Open dimon222 opened this issue 7 years ago • 3 comments

I know I have done some pull requests that at some point were breaking script on several VPS configs. It would be good to have some Unit testing for current script, so it can be prevented in the future (or at least warned before it gets merged by accident).

So far it doesn't seem to be trivial at all, since we basically have one big bash script. I quite expect this issue to be opened for a while.

There are multiple things to be tested like regression test of performance, functionality on special cases (missing installs for some apps), text offsets and other things.

I do really like this Bats option. Not sure yet how we can implement it. Its quite possible that some reorganization of script will be required like more atomic functions.

dimon222 avatar May 22 '17 02:05 dimon222

Definitely sounds like a good idea. Imho the difficulty will be the wide array of os'es FireMotD supports. What exactly do you mean with 'more atomic functions'?

willemdh avatar May 22 '17 09:05 willemdh

Bats is mainly used for one-liner tests. I'm not quite sure if there's any other approach other than having big amount of functions, which at this moment FireMotD doesn't really have.

dimon222 avatar May 22 '17 11:05 dimon222

I'm going to assign this to you @dimon222 As I never used Bats

willemdh avatar Oct 07 '17 18:10 willemdh