stretchr / gorc

Recursive go testing, done better.
141 stars 2 forks source link

Consider Pre and Post flight scripts #13

Closed tylerstillwater closed 10 years ago

tylerstillwater commented 11 years ago

Would it be useful to be able to define pre and post flight scripts to be run by gort?

Example: for my tests to succeed, a database server must be running. I could write a script to start the server and a script to stop the server, then:

gort preflight add startDB.sh gort preflight add stopDB.sh

When I run the tests, the preflight script is run, and if it has an exit status of 0, gort runs the tests, then the postflight script is run.

Obviously we would need the following: gort preflight remove gort postflight remove gort preflight show gort postflight show

or similar.