Merge branch 'knapsack-env-ci' into 'master'

Enable Knapsack only in CI environment

Fixes running tests locally. Enables Knapsack only in CI environment.

cc @grzesiek 

See merge request !4528
This commit is contained in:
Kamil Trzciński 2016-06-08 12:06:16 +00:00
commit c0f31845d3
3 changed files with 9 additions and 4 deletions

View file

@ -38,6 +38,7 @@ v 8.9.0 (unreleased)
- Make authentication service for Container Registry to be compatible with < Docker 1.11
- Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav
- Use Knapsack only in CI environment
- Cache project build count in sidebar nav
- Reduce number of queries needed to render issue labels in the sidebar
- Improve error handling importing projects

View file

@ -11,13 +11,15 @@ ENV['RAILS_ENV'] = 'test'
require './config/environment'
require 'rspec/expectations'
require 'sidekiq/testing/inline'
require 'knapsack'
require_relative 'capybara'
require_relative 'db_cleaner'
require_relative 'rerun'
Knapsack::Adapters::SpinachAdapter.bind
if ENV['CI']
require 'knapsack'
Knapsack::Adapters::RSpecAdapter.bind
end
%w(select2_helper test_env repo_helpers).each do |f|
require Rails.root.join('spec', 'support', f)

View file

@ -15,9 +15,11 @@ require 'rspec/rails'
require 'shoulda/matchers'
require 'sidekiq/testing/inline'
require 'rspec/retry'
require 'knapsack'
Knapsack::Adapters::RSpecAdapter.bind
if ENV['CI']
require 'knapsack'
Knapsack::Adapters::RSpecAdapter.bind
end
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.