From 4cbc449a51ce4836152984938e1f161976b6a8fe Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 9 Oct 2018 16:54:08 +1100 Subject: [PATCH 1/2] Remove unused parallel_tests gem Reverts db47c01784df955cff00560f3c4b5454467025dd --- .rspec_parallel | 4 ---- Gemfile | 1 - Gemfile.lock | 3 --- config/database.yml | 2 +- 4 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 .rspec_parallel diff --git a/.rspec_parallel b/.rspec_parallel deleted file mode 100644 index cee31855e2..0000000000 --- a/.rspec_parallel +++ /dev/null @@ -1,4 +0,0 @@ ---format Fuubar ---format ParallelTests::RSpec::SummaryLogger --out tmp/spec_summary.log ---format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log ---tag ~performance diff --git a/Gemfile b/Gemfile index 78c9109b10..b0dbe9e9fb 100644 --- a/Gemfile +++ b/Gemfile @@ -142,7 +142,6 @@ group :development do gem 'guard-livereload' gem 'guard-rails' gem 'guard-rspec', '~> 4.7.3' - gem 'parallel_tests' gem 'rubocop', '>= 0.49.1' # 1.0.9 fixed openssl issues on macOS https://github.com/eventmachine/eventmachine/issues/602 diff --git a/Gemfile.lock b/Gemfile.lock index 87be4a4f6d..d2226b0368 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -551,8 +551,6 @@ GEM cocaine (~> 0.5.3) mime-types parallel (1.11.2) - parallel_tests (2.14.1) - parallel parser (2.5.1.0) ast (~> 2.4.0) paypal-sdk-core (0.2.10) @@ -809,7 +807,6 @@ DEPENDENCIES oj paper_trail (~> 3.0.8) paperclip - parallel_tests pg poltergeist (>= 1.16.0) pry-byebug (>= 3.4.3) diff --git a/config/database.yml b/config/database.yml index 7f55b6c499..d313dd74e4 100644 --- a/config/database.yml +++ b/config/database.yml @@ -10,7 +10,7 @@ development: test: adapter: postgresql encoding: unicode - database: open_food_network_test<%= ENV['TEST_ENV_NUMBER'] %> + database: open_food_network_test pool: 5 host: localhost username: ofn From 245d900b58d472c744846dec3d559a316b3d5662 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 9 Oct 2018 17:06:59 +1100 Subject: [PATCH 2/2] Remove unused CI scripts We used to have our own CI server, but now we are using Travis and Semaphore. We don't need these scripts any more. And since parallel_tests was removed in the previous commit, they are broken anyway. --- script/ci/includes.sh | 13 ------------- script/ci/run_js_tests.sh | 17 ----------------- script/ci/run_tests.sh | 21 --------------------- 3 files changed, 51 deletions(-) delete mode 100755 script/ci/run_js_tests.sh delete mode 100755 script/ci/run_tests.sh diff --git a/script/ci/includes.sh b/script/ci/includes.sh index bcb5662469..8981b76ee4 100644 --- a/script/ci/includes.sh +++ b/script/ci/includes.sh @@ -1,10 +1,3 @@ -function load_environment { - source /var/lib/jenkins/.rvm/environments/ruby-2.1.5 - if [ ! -f config/application.yml ]; then - ln -s application.yml.example config/application.yml - fi -} - function require_env_vars { for var in "$@"; do eval value=\$$var @@ -66,12 +59,6 @@ function get_ofn_commit { fi } -function checkout_ofn_commit { - OFN_COMMIT=`buildkite-agent meta-data get "openfoodnetwork:git:commit"` - echo "Checking out stored commit $OFN_COMMIT" - git checkout -qf "$OFN_COMMIT" -} - function drop_and_recreate_database { # Adapted from: http://stackoverflow.com/questions/12924466/capistrano-with-postgresql-error-database-is-being-accessed-by-other-users DB=$1 diff --git a/script/ci/run_js_tests.sh b/script/ci/run_js_tests.sh deleted file mode 100755 index cd274eaf47..0000000000 --- a/script/ci/run_js_tests.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -echo "--- Loading environment" -source ./script/ci/includes.sh -load_environment -checkout_ofn_commit - -echo "--- Verifying branch is based on current master" -exit_unless_master_merged - -echo "--- Bundling" -bundle install - -echo "--- Running tests" -./script/karma run diff --git a/script/ci/run_tests.sh b/script/ci/run_tests.sh deleted file mode 100755 index efae0805a6..0000000000 --- a/script/ci/run_tests.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -e - -echo "--- Loading environment" -source ./script/ci/includes.sh -load_environment -checkout_ofn_commit - -echo "--- Verifying branch is based on current master" -exit_unless_master_merged - -echo "--- Bundling" -bundle install - -echo "--- Loading test database" -bundle exec rake db:drop db:create db:schema:load -bundle exec rake parallel:drop parallel:create parallel:load_schema - -echo "--- Running tests" -bundle exec rake parallel:spec