Test::Drive

Gem Version Build Status Dependency Status Code Climate Coverage Status

A simple command-line tool for running a Jenkins test job before pushing code to a remote repo

Installation

$ gem install test-drive

Usage

$ test-drive -h

Usage: test-drive [options]

A simple command-line tool for running a Jenkins test job before pushing code to a remote repo

v0.0.3

Options:
    -h, --help                       Show command line help
    -s, --server JENKINS_URL         URL for the Jenkins server
    -u, --user USER                  Jenkins user ID
    -p, --password API_KEY           Jenkins password or API token
    -j, --job TARGET_JOB             Jenkins job to be triggered
    -n, --[no-]push                  Option to enable (or suppress) pushing to the remote repo
        --version                    Show help/version info
        --log-level LEVEL            Set the logging level
                                     (debug|info|warn|error|fatal)
                                     (Default: info)

Default values can be placed in ~/.test-drive.yml

Jenkins Config

This app assumes that you have a Jenkins job already configured as follows:

  • It takes a file parameter called 'patch'
  • It pulls or your source code from origin/master and executes a shell command that runs

    echo "" >> $WORKSPACE/patch git apply $WORKSPACE/patch

  • It then executes your desired test suite and runs

    git apply --reverse $WORKSPACE/patch

to teardown (optional but recommended)

Local Config

On first run, you will have the option of saving your Jenkins credentials to a config file at ~/.test-drive.yml. This file may be edited to include any of the allowed options as defaults.

---
server: https://jenkins.your_org.com/
user: user@your_org.com
password: xxxxxxxxxxxxxxxxxxxxxxxxx
job: YourDefaultJob
push: false

Contributing

  1. Fork it ( https://github.com/[my-github-username]/test-drive/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request