GithubHelp home page GithubHelp logo

isabella232 / rails-app-with-knapsack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from knapsackpro/rails-app-with-knapsack

0.0 0.0 0.0 162 KB

Example of Ruby on Rails app with knapsack gem. Knapsack is a free gem, see https://github.com/ArturT/knapsack

License: MIT License

JavaScript 1.15% CSS 1.03% Ruby 79.69% HTML 10.53% CoffeeScript 0.63% Gherkin 4.57% Shell 0.31% SCSS 2.08%

rails-app-with-knapsack's Introduction

Rails app with knapsack

Circle CI

This is example Ruby on Rails app with knapsack gem. Knapsack splits tests across CI nodes and makes sure that tests will run comparable time on each node.

You can read more about free knapsack gem here. You will find there info how to set up your test suite and how to do it on your favorite CI server.

How to load knapsack rake tasks

See Rakefile.

Parallel rspec test suite with knapsack

How to set up knapsack

See spec/spec_helper.rb

Step 1

First generate only once a report knapsack_rspec_report.json on your CI with command:

$ KNAPSACK_GENERATE_REPORT=true bundle exec rspec spec

Add the report into your repository and commit.

Step 2

You can use below command on CI to run tests:

# Run this on first CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=0 bundle exec rake knapsack:rspec

# Run this on second CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=1 bundle exec rake knapsack:rspec

See .circleci/config.yml to see how we set up CircleCI.

Parallel cucumber test suite with knapsack

How to set up knapsack

See features/support/knapsack.rb

Step 1

First generate only once a report knapsack_cucumber_report.json on your CI with command:

$ KNAPSACK_GENERATE_REPORT=true bundle exec cucumber features

Add the report into your repository and commit.

Step 2

You can use below command on CI to run tests:

# Run this on first CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=0 bundle exec rake knapsack:cucumber

# Run this on second CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=1 bundle exec rake knapsack:cucumber

See .circleci/config.yml to see how we set up CircleCI.

Parallel minitest test suite with knapsack

How to set up knapsack

See test/test_helper.rb

Step 1

First generate only once a report knapsack_minitest_report.json on your CI with command:

$ KNAPSACK_GENERATE_REPORT=true bundle exec rake test

Add the report into your repository and commit.

Step 2

You can use below command on CI to run tests:

# Run this on first CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=0 bundle exec rake knapsack:minitest

# Run this on second CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=1 bundle exec rake knapsack:minitest

See .circleci/config.yml to see how we set up CircleCI.

Parallel spinach test suite with knapsack

How to set up knapsack

See spinach_features/support/env.rb

Step 1

First generate only once a report knapsack_spinach_report.json on your CI with command:

$ KNAPSACK_GENERATE_REPORT=true bundle exec spinach -f spinach_features

Add the report into your repository and commit.

Step 2

You can use below command on CI to run tests:

# Run this on first CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=0 KNAPSACK_TEST_FILE_PATTERN="spinach_features/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_features]"

# Run this on second CI server
$ CI_NODE_TOTAL=2 CI_NODE_INDEX=1 KNAPSACK_TEST_FILE_PATTERN="spinach_features/**{,/*/**}/*.feature" bundle exec rake "knapsack:spinach[-f spinach_features]"

See .circleci/config.yml to see how we set up CircleCI.

rails-app-with-knapsack's People

Contributors

arturt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.