I am trying to unit test my build script.
I think following testing scenarios are normal scenarios
What are all the other test cases may be commonly applicable for build script?
The developing unit should write them as they come to implement the class. The issue you may run into if others write the tests is that the external force will influence the design. TDD works well when the developers are doing the design. With BDD/ATDD the QA/PO should be involved.
A typical unit test contains 3 phases: First, it initializes a small piece of an application it wants to test (also known as the system under test, or SUT), then it applies some stimulus to the system under test (usually by calling a method on it), and finally, it observes the resulting behavior.
For the "what are other test cases" - You probably want to test that it handles failures correctly - if a disk fails, if the compile fails, there's some other I/O error. Whatever your error procedures are, you should test for those.
Does your build script run your automated tests also? You might want to check that it actually runs those (getting recursive here), and reports failures from those correctly.
Testing the version numbers seems straightforward. I assume you are passing the version numbers to the script (or have some other easily identifiable way of figuring out what they should be). Check that your build artifacts have those numbers in the filename/readme/whereever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With