Skip to content

Dev guide

C. Dylan Shearer edited this page Dec 27, 2017 · 3 revisions

Tools

For compiling and running unit tests:

  1. Go >= 1.7
  2. make

For running smoke test:

  1. Docker

For running system tests:

  1. Vagrant
  2. VirtualBox

General Flow

Branch master contains work for the next release. All changes must be done on feature branches, and there preferably should be a 1-1 correspondence between feature branches and issues.

When ready to merge, push the feature branch to Github and then make a pull request (for merging to master). This will cause Travis CI to run the smoke test, and it will not be possible to merge the PR until this test passes.

Testing

Unit Tests

Unit tests are run during the smoke test and during any platform test. To run them locally, from the root of the repo do make check.

The unit tests are traditional Go unit tests, with the addition of the library testify.

Smoke Test

The smoke test is run automatically by Travis CI when a PR is made. It does the following:

  1. Launch a CentOS Docker container
  2. Copy the Jobber source into the container
  3. Build the Jobber RPM for CentOS 6
  4. Install the RPM
  5. Run the platform test

If you want to run it locally, make sure Docker is running, then do make -C smoke_tests.

System Tests

The system tests test Jobber on specific operating systems. Each one does two main things:

  1. Test the creation and installation of the OS-specific package
  2. Test the behavior of Jobber on that OS

They rely on virtual machines, which are automatically managed by make scripts using Vagrant.

The package-creation scripts are in respective directories in packaging.

Testing Jobber's behavior is done by the platform test, which uses Robot Framework.

To run a system test locally, make sure VirtualBox and Vagrant are installed, and then do make -C packaging/<os> test-vm --- e.g., make -C packaging/centos_6 test-vm.

Clone this wiki locally