Skip to content

Commit

Permalink
Exclude sphinx from normal spec run
Browse files Browse the repository at this point in the history
  • Loading branch information
amaierhofer committed Jan 9, 2020
1 parent 4cabfe2 commit 0e42c10
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/tasks/ci.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ task :ci do
'db:migrate',
'ci:setup:env',
'ci:setup:rspec',
'spec:sphinx',
# 'spec:features', # run feature specs first to get coverage from spec
'spec'].delete_if { |task| tasks_to_skip.include?(task) }

Expand Down
5 changes: 5 additions & 0 deletions lib/tasks/spec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
if Rake::Task.task_defined?('spec:features') # only if current environment knows rspec
Rake::Task['spec:features'].actions.clear
namespace :spec do
RSpec::Core::RakeTask.new(:sphinx) do |t|
t.pattern = './spec/**/*_spec.rb'
t.rspec_opts = '--tag sphinx'
end

RSpec::Core::RakeTask.new(:features) do |t|
t.pattern = './spec/features/**/*_spec.rb'
t.rspec_opts = '--tag type:feature'
Expand Down
2 changes: 1 addition & 1 deletion spec/domain/search_strategies/sphinx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

require 'spec_helper'

describe SearchStrategies::Sphinx, :mysql do
describe SearchStrategies::Sphinx, sphinx: true do

sphinx_environment(:people, :groups, :events) do

Expand Down
2 changes: 1 addition & 1 deletion spec/features/quicksearch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

require 'spec_helper'

describe 'Quicksearch', :mysql do
describe 'Quicksearch', sphinx: true do

sphinx_environment(:people, :groups, :events) do
it 'finds people and groups', js: true do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
config.include Warden::Test::Helpers, type: :feature

config.filter_run_excluding type: 'feature', performance: true
config.filter_run_excluding type: 'sphinx', sphinx: true

if ActiveRecord::Base.connection.adapter_name.downcase != 'mysql2' # rubocop:disable Performance/Casecmp
config.filter_run_excluding :mysql
Expand Down

0 comments on commit 0e42c10

Please sign in to comment.