Commit 83736987 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-teaspoon-task' into 'master'

Restrict teaspoon tasks introduced by !6059 to development environment.

Otherwise we get syntax errors in production environment, see https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6059#note_17597729

See merge request !7189
parents b216d9bf 8a9c7b1e
Rake::Task['teaspoon'].clear if Rake::Task.task_defined?('teaspoon') unless Rails.env.production?
Rake::Task['teaspoon'].clear if Rake::Task.task_defined?('teaspoon')
namespace :teaspoon do namespace :teaspoon do
desc 'GitLab | Teaspoon | Generate fixtures for JavaScript tests' desc 'GitLab | Teaspoon | Generate fixtures for JavaScript tests'
RSpec::Core::RakeTask.new(:fixtures) do |t| RSpec::Core::RakeTask.new(:fixtures) do |t|
ENV['NO_KNAPSACK'] = 'true' ENV['NO_KNAPSACK'] = 'true'
...@@ -14,10 +15,11 @@ namespace :teaspoon do ...@@ -14,10 +15,11 @@ namespace :teaspoon do
options = {} options = {}
abort('rake teaspoon:tests failed') if Teaspoon::Console.new(options).failures? abort('rake teaspoon:tests failed') if Teaspoon::Console.new(options).failures?
end end
end end
desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests' desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests'
task :teaspoon do task :teaspoon do
Rake::Task['teaspoon:fixtures'].invoke Rake::Task['teaspoon:fixtures'].invoke
Rake::Task['teaspoon:tests'].invoke Rake::Task['teaspoon:tests'].invoke
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment