RSpec ROX Client

RSpec client for ROX Center.

Gem Version

Requirements

  • RSpec 2.14

Installation

In your Gemfile:

gem 'rox-client-rspec', '~> 0.3.0'

Manually:

gem install rox-client-rspec

Usage

If you haven't done it already, follow the setup procedure below.

To track a test, you must assign it a ROX test key generated from your ROX Center server.

NOTE: currently, all the tests in your test suite must be assigned a test key for the client to work.

Test keys are assigned to test using RSpec metadata:

it "should work", rox: { key: 'abcdefghijkl' } do
  expect(true).to be_true
end

it(nil, rox: { key: 'bcdefghijklm' }){ should validate_presence_of(:name) }

Setup

ROX clients use YAML files for configuration. To use the RSpec ROX Client, you need two configuration files and you must set up the client in your spec helper file.

In your home folder, you must create the ~/.rox/config.yml configuration file.

# List of ROX Center servers you can submit test results to.
servers:
  rox.example.com:                        # A custom name for your ROX Center server.
                                          # You will use this in the client configuration file.
                                          # We recommend using the domain name where you deployed it.

    apiUrl: https://rox.example.com/api   # The URL of your ROX Center server's API.
                                          # This is the domain where you deployed it with /api.

    apiKeyId: 39fuc7x85lsoy9c0ek2d        # Your user credentials on this server.
    apiKeySecret: mwpqvvmagzoegxnqptxdaxkxonjmvrlctwcrfmowibqcpnsdqd

# If true, test results will be uploaded to ROX Center.
# Set to false to temporarily disable publishing.
# You can change this at runtime from the command line by setting the
# ROX_PUBLISH environment variable to 0 (false) or 1 (true).
publish: true

In the project directory where you run RSpec, you must add the rox.yml client configuration file:

# Configuration specific to your project.
project:
  apiId: 154sic93pxs0   # The API key of your project in the ROX Center server.
  version: 1.2.3

# Where the client should store its temporary files.
# The client will work without it but it is required for some advanced features.
workspace: tmp/rox

# Client advanced features.
payload:

  # Saves a copy of the test payload sent to the ROX Center server for debugging.
  # The file will be saved in rspec/servers/<SERVER_NAME>/payload.json.
  save: false

  # If you track a large number of tests (more than a thousand), enabling this
  # will reduce the size of the test payloads sent to ROX Center server by caching
  # test information that doesn't change often such as the name.
  cache: false

  # Prints a copy of the test payload sent to the ROX Center server for debugging.
  # Temporarily enable at runtime by setting the ROX_PRINT_PAYLOAD environment variable to 1.
  print: false

# The name of the ROX Center server to upload test results to.
# This name must be one of the server names in the ~/.rox/config.yml file.
# You can change this at runtime from the command line by setting the
# ROX_SERVER environment variable.
server: rox.example.com

Finally, you must enable the client in your spec helper file (usually spec/spec_helper.rb).

RoxClient::RSpec.configure do |config|

  # Optional ROX Center category to add to all the tests sent with this client.
  config.project.category = 'RSpec'
end

The next time you run your test suite, the RSpec ROX Client will send the results to your ROX Center server.

Contributing

  • Fork
  • Create a topic branch - git checkout -b my_feature
  • Push to your branch - git push origin my_feature
  • Create a pull request from your branch

Please add a changelog entry with your name for new features and bug fixes.

License

The RSpec ROX Client is licensed under the MIT License. See LICENSE.txt for the full license.