Split testing into unit and functional tests.

* Split the `test` nimble task into `unittest` and `functest`, with
  corresponding test directories and test runners.
* Added documentation in README regarding building and testing StrawBoss.
* Created a small, simple test project for use in the functional tests.
* Added a `keepEnv` template in the server unit test code to make it easy to
  preserve the working environment for a single unit test to invistigate
  failures manually.
This commit is contained in:
Jonathan Bernard
2017-05-10 11:44:46 -05:00
parent fd804a9aa8
commit 37682441ea
15 changed files with 184 additions and 78 deletions

View File

@ -219,3 +219,43 @@ using the handler to update the supervisor's knowledge of the build results and
When launched in single-build mode there is no supervisory process. The main
process directly executes the requested build steps.
### Building StrawBoss
To build StrawBoss locally, checkout the repository and in the repo root run:
nimble build
### Testing
StrawBoss has two test suites, a set of unit tests and a set of functional
tests. All the test code and assets live under the `src/test` subdirectory.
Each test suite has a runner file that serves as an entry for the test process,
named `run_unit_tests.nim` and `run_functional_tests.nim`.
#### Unit Tests
The unit test soruce files live in the `nim/unit` subdirectory and have a
one-to-one correspondence with the StrawBoss source files following this
naming convention: `t<module>.nim`. The unit tests are intended to be run any
time the code is recompiled.
To run the unit tests, use the `unittest` nimble task:
nimble unittest
#### Functional Tests
The functional test source files live in the `nim/functional` subdirectory.
There is a test project that is used to excercise StrawBoss functionality. To
avoid external coupling it is stored within the StrawBoss repository as a test
asset. To avoid `git` complications it is stored as a Gzipped TAR file and
unpacked to a temporary directory as part of the functional test process.
As the functional tests are more time-consuming and intensive, they are
expected to bu run when performing a build.
To run the functional tests, use the `functest` nimble task:
nimble functest