diff --git a/.travis.yml b/.travis.yml index 088faea8..2fd7e4ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ rvm: - 2.3.0 - 2.0.0-p598 # CentOS 7 - 2.1.5 # Debian 8 +cache: bundler addons: postgresql: "9.3" @@ -11,41 +12,42 @@ before_install: - if ruby --version | cut -d ' ' -f 2 | grep -q 2.1.5p273 ; then gem update --system 2.4.8; fi before_script: - - git clone https://github.com/mezuro/kalibro_install.git -b v4.2 kalibro_install - - export KALIBRO_CONFIGURATIONS_START=0 - - export KALIBRO_PROCESSOR_START=0 - - pushd kalibro_install - # - # Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details - # - # In 2016/04/27 the state is: - # * The first issue has been closed and apparently fixed by a PR - # * The second one has been closed without a PR and removing the workaround below breaks the build - # - - sudo apt-get remove libzmq3 - - bash install.sh - - popd - cp config/database.yml.sample config/database.yml - cp config/kalibro.yml.sample config/kalibro.yml # Do not run setup as the Kalibro services are up and this is not even necessary! - bundle exec rake db:create - bundle exec rake db:migrate - - cp features/support/kalibro_cucumber_helpers.yml.sample features/support/kalibro_cucumber_helpers.yml - export BUNDLE_GEMFILE=$PWD/Gemfile - export CODECLIMATE_REPO_TOKEN=045c2433d496f108c0c6afa5516a72ddbfb1868fb34bf7a9bd095b7a0ea34a79 +env: + global: + - CI_NODE_TOTAL=4 + matrix: + - TASK=spec + - TASK=konacha:run + - CI_NODE_INDEX=0 TASK=knapsack:cucumber + - CI_NODE_INDEX=1 TASK=knapsack:cucumber + - CI_NODE_INDEX=2 TASK=knapsack:cucumber + - CI_NODE_INDEX=3 TASK=knapsack:cucumber + script: - # Unit tests - - bundle exec rake spec - - bundle exec rake konacha:run - # - # Start kalibro for acceptance tests - - pushd kalibro_install - - bash start_kalibro_services.sh - - popd - # - # Acceptance tests - - bundle exec rake cucumber +# cucumber setup +# +# Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details +# +# In 2016/04/27 the state is: +# * The first issue has been closed and apparently fixed by a PR +# * The second one has been closed without a PR and removing the workaround below breaks the build +# + - 'if [ "$TASK" = "knapsack:cucumber" ]; + then + git clone https://github.com/mezuro/kalibro_install.git -b v4.2 kalibro_install && + sudo apt-get remove libzmq3 && + bash kalibro_install/install.sh && + cp features/support/kalibro_cucumber_helpers.yml.sample features/support/kalibro_cucumber_helpers.yml; + fi' + - bundle exec rake $TASK notifications: email: diff --git a/Gemfile b/Gemfile index 340c199e..809cadca 100644 --- a/Gemfile +++ b/Gemfile @@ -129,6 +129,9 @@ group :development, :test do # Automatized gem update gem 'gisdatigo' + + # Slice tests across jobs on CI + gem 'knapsack' end # Acceptance tests diff --git a/Gemfile.lock b/Gemfile.lock index 68393786..0aba83b9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -158,6 +158,9 @@ GEM activesupport (>= 2.2.1) faraday_middleware (~> 0.9) likeno (~> 1.1) + knapsack (1.11.1) + rake + timecop (>= 0.1.0) konacha (3.7.0) actionpack (>= 3.1, < 5) capybara @@ -306,6 +309,7 @@ GEM thor (0.19.1) thread_safe (0.3.5) tilt (2.0.1) + timecop (0.8.1) turbolinks (2.5.3) coffee-rails tzinfo (1.2.2) @@ -361,6 +365,7 @@ DEPENDENCIES jquery-ui-rails (~> 5.0.0) js-routes (~> 1.1.0) kalibro_client (~> 4.0) + knapsack konacha less-rails (~> 2.7.0) mocha diff --git a/Rakefile b/Rakefile index ba6b733d..21270ac2 100644 --- a/Rakefile +++ b/Rakefile @@ -4,3 +4,5 @@ require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks + +Knapsack.load_tasks if defined?(Knapsack) diff --git a/config/cucumber.yml b/config/cucumber.yml index 19b288df..8d52743e 100644 --- a/config/cucumber.yml +++ b/config/cucumber.yml @@ -1,7 +1,7 @@ <% rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" -std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" +std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip -r features/support -r features/step_definitions" %> default: <%= std_opts %> features wip: --tags @wip:3 --wip features diff --git a/features/support/knapsack.rb b/features/support/knapsack.rb new file mode 100644 index 00000000..68567fee --- /dev/null +++ b/features/support/knapsack.rb @@ -0,0 +1,5 @@ +require 'knapsack' + +# CUSTOM_CONFIG_GOES_HERE + +Knapsack::Adapters::CucumberAdapter.bind diff --git a/knapsack_cucumber_report.json b/knapsack_cucumber_report.json new file mode 100644 index 00000000..de5f81fd --- /dev/null +++ b/knapsack_cucumber_report.json @@ -0,0 +1,48 @@ +{ + "features/compound_metric_configuration/create.feature": 62.18502473831177, + "features/compound_metric_configuration/edition.feature": 5.280540943145752, + "features/compound_metric_configuration/show.feature": 1.1183347702026367, + "features/golden_path/configure_and_process.feature": 45.340739727020264, + "features/homepage.feature": 1.4655566215515137, + "features/hotspot_metric_configuration/create.feature": 2.4630019664764404, + "features/hotspot_metric_configuration/listing.feature": 1.5519781112670898, + "features/kalibro_configuration/create.feature": 4.129258632659912, + "features/kalibro_configuration/deletion.feature": 2.331482410430908, + "features/kalibro_configuration/edition.feature": 6.806136608123779, + "features/kalibro_configuration/listing.feature": 2.481926918029785, + "features/kalibro_configuration/show.feature": 0.8330433368682861, + "features/kalibro_range/create.feature": 73.9750828742981, + "features/kalibro_range/deletion.feature": 2.737761974334717, + "features/kalibro_range/edit.feature": 2.685701608657837, + "features/project/create.feature": 3.224186897277832, + "features/project/deletion.feature": 2.8389909267425537, + "features/project/edition.feature": 7.320446014404297, + "features/project/listing.feature": 1.9537205696105957, + "features/project/show.feature": 7.6062610149383545, + "features/reading/delete.feature": 1.7271461486816406, + "features/reading/edit.feature": 3.340810537338257, + "features/reading/new.feature": 10.781737089157104, + "features/reading_group/create.feature": 3.8599812984466553, + "features/reading_group/delete.feature": 2.189305305480957, + "features/reading_group/edit.feature": 6.348893404006958, + "features/reading_group/listing.feature": 2.820152997970581, + "features/reading_group/show.feature": 2.9745709896087646, + "features/repository/create.feature": 195.79930686950684, + "features/repository/delete.feature": 41.15431094169617, + "features/repository/edit.feature": 5.563234329223633, + "features/repository/index.feature": 3.253945827484131, + "features/repository/notify_push.feature": 5.197679042816162, + "features/repository/show/date_select.feature": 2.9266037940979004, + "features/repository/show/hotspot_metric_results.feature": 8.351153373718262, + "features/repository/show/independent.feature": 2.8546195030212402, + "features/repository/show/metric_results.feature": 8.994091033935547, + "features/repository/show/modules_tree.feature": 10.95845913887024, + "features/repository/show/repository_info.feature": 261.22219729423523, + "features/tree_metric_configuration/create.feature": 88.31925344467163, + "features/tree_metric_configuration/delete.feature": 1.756983757019043, + "features/tree_metric_configuration/edition.feature": 3.4839460849761963, + "features/tree_metric_configuration/listing.feature": 3.238276720046997, + "features/tree_metric_configuration/show.feature": 3.814218521118164, + "features/users/user_projects.feature": 0.9753031730651855, + "features/users/user_update.feature": 1.832406759262085 +} \ No newline at end of file