Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unit test build script?

I am trying to unit test my build script.

I think following testing scenarios are normal scenarios

  1. Verify the build version number correctness
  2. Verify version numbers of msi and verify whether they are latest?
  3. Verify whether all the assemblies were strong name signed
  4. verify whether compilation failures were communicated to responsible person?

What are all the other test cases may be commonly applicable for build script?

like image 570
Samselvaprabu Avatar asked Jan 04 '12 18:01

Samselvaprabu


People also ask

How should developers write unit tests?

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.

How do you structure a unit test?

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.


1 Answers

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.

like image 51
Kane Avatar answered Sep 22 '22 05:09

Kane