README.md in knapsack_pro-0.2.0 vs README.md in knapsack_pro-0.2.1

- old
+ new

@@ -44,18 +44,19 @@ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [Update gem](#update-gem) - [Installation](#installation) -- [Usage](#usage) - - [Step for RSpec](#step-for-rspec) - - [Step for Cucumber](#step-for-cucumber) - - [Step for Minitest](#step-for-minitest) - - [Custom configuration](#custom-configuration) -- [Setup your CI server](#setup-your-ci-server) - - [Set API key token](#set-api-key-token) - - [Set knapsack_pro command to execute tests](#set-knapsack_pro-command-to-execute-tests) +- [How to set up](#how-to-set-up) + - [Usage](#usage) + - [Step for RSpec](#step-for-rspec) + - [Step for Cucumber](#step-for-cucumber) + - [Step for Minitest](#step-for-minitest) + - [Custom configuration](#custom-configuration) + - [Setup your CI server](#setup-your-ci-server) + - [Set API key token](#set-api-key-token) + - [Set knapsack_pro command to execute tests](#set-knapsack_pro-command-to-execute-tests) - [Extra configuration for CI server](#extra-configuration-for-ci-server) - [Info about ENV variables](#info-about-env-variables) - [Repository adapter](#repository-adapter) - [When you set global variable `KNAPSACK_PRO_REPOSITORY_ADAPTER=git` (optional)](#when-you-set-global-variable-knapsack_pro_repository_adaptergit-optional) - [When you NOT set global variable `KNAPSACK_PRO_REPOSITORY_ADAPTER` (default)](#when-you-not-set-global-variable-knapsack_pro_repository_adapter-default) @@ -99,17 +100,19 @@ ```ruby KnapsackPro.load_tasks if defined?(KnapsackPro) ``` -## Usage +## How to set up +### Usage + You can find here example of rails app with already configured knapsack_pro. https://github.com/KnapsackPro/rails-app-with-knapsack_pro -### Step for RSpec +#### Step for RSpec Add at the beginning of your `spec_helper.rb`: ```ruby require 'knapsack_pro' @@ -117,11 +120,11 @@ # CUSTOM_CONFIG_GOES_HERE KnapsackPro::Adapters::RSpecAdapter.bind ``` -### Step for Cucumber +#### Step for Cucumber Create file `features/support/knapsack_pro.rb` and add there: ```ruby require 'knapsack_pro' @@ -129,11 +132,11 @@ # CUSTOM_CONFIG_GOES_HERE KnapsackPro::Adapters::CucumberAdapter.bind ``` -### Step for Minitest +#### Step for Minitest Add at the beginning of your `test_helper.rb`: ```ruby require 'knapsack_pro' @@ -142,34 +145,34 @@ knapsack_pro_adapter = KnapsackPro::Adapters::MinitestAdapter.bind knapsack_pro_adapter.set_test_helper_path(__FILE__) ``` -### Custom configuration +#### Custom configuration You can change default Knapsack Pro configuration for RSpec, Cucumber or Minitest tests. Here are examples what you can do. Put below configuration instead of `CUSTOM_CONFIG_GOES_HERE`. ```ruby # you can use your own logger require 'logger' KnapsackPro.logger = Logger.new(STDOUT) KnapsackPro.logger.level = Logger::INFO ``` -## Setup your CI server +### Setup your CI server -### Set API key token +#### Set API key token Set one or a few tokens depend on how many test suites you run on CI server. * `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` - as value set token for rspec test suite. Token can be generated when you sign in to [knapsackpro.com](http://www.knapsackpro.com). * `KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER` - token for cucumber test suite. * `KNAPSACK_PRO_TEST_SUITE_TOKEN_MINITEST` - token for minitest test suite. __Tip:__ In case you have for instance multiple rspec test suites then prepend each of knapsack_pro command which executes tests with `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` variable. -### Set knapsack_pro command to execute tests +#### Set knapsack_pro command to execute tests On your CI server run this command for the first CI node. Update `KNAPSACK_PRO_CI_NODE_INDEX` for the next one. # Step for RSpec $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec @@ -181,16 +184,18 @@ $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest You can add `KNAPSACK_PRO_TEST_FILE_PATTERN` if your tests are not in default directory. For instance: # Step for RSpec - $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_specs/**/*_spec.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec + $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_specs/**{,/*/**}/*_spec.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec # Step for Cucumber - $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber + $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**{,/*/**}/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber # Step for Minitest - $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest + $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest + +__Tip:__ If you are using one of supported CI providers then instead of above steps you should [take a look on this](#supported-ci-providers). ## Extra configuration for CI server ### Info about ENV variables