summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorwinniehell <git@winniehell.de>2016-10-29 13:22:32 +0200
committerwinniehell <git@winniehell.de>2016-10-29 13:22:32 +0200
commit8a9c7b1e04461f3dffa156a56bc25e77eda2fd9c (patch)
tree98d4f0434ce0b1b5eefe7dfcf79fffcf58ea386b /lib
parentdcc699afc214dab1e27541ac35a9d57ef20f2cb9 (diff)
downloadgitlab-ce-8a9c7b1e04461f3dffa156a56bc25e77eda2fd9c.tar.gz
Ignore teaspoon tasks in production environment
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/teaspoon.rake38
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/tasks/teaspoon.rake b/lib/tasks/teaspoon.rake
index 156fa90537d..08caedd7ff3 100644
--- a/lib/tasks/teaspoon.rake
+++ b/lib/tasks/teaspoon.rake
@@ -1,23 +1,25 @@
-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
- desc 'GitLab | Teaspoon | Generate fixtures for JavaScript tests'
- RSpec::Core::RakeTask.new(:fixtures) do |t|
- ENV['NO_KNAPSACK'] = 'true'
- t.pattern = 'spec/javascripts/fixtures/*.rb'
- t.rspec_opts = '--format documentation'
- end
+ namespace :teaspoon do
+ desc 'GitLab | Teaspoon | Generate fixtures for JavaScript tests'
+ RSpec::Core::RakeTask.new(:fixtures) do |t|
+ ENV['NO_KNAPSACK'] = 'true'
+ t.pattern = 'spec/javascripts/fixtures/*.rb'
+ t.rspec_opts = '--format documentation'
+ end
- desc 'GitLab | Teaspoon | Run JavaScript tests'
- task :tests do
- require "teaspoon/console"
- options = {}
- abort('rake teaspoon:tests failed') if Teaspoon::Console.new(options).failures?
+ desc 'GitLab | Teaspoon | Run JavaScript tests'
+ task :tests do
+ require "teaspoon/console"
+ options = {}
+ abort('rake teaspoon:tests failed') if Teaspoon::Console.new(options).failures?
+ end
end
-end
-desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests'
-task :teaspoon do
- Rake::Task['teaspoon:fixtures'].invoke
- Rake::Task['teaspoon:tests'].invoke
+ desc 'GitLab | Teaspoon | Shortcut for teaspoon:fixtures and teaspoon:tests'
+ task :teaspoon do
+ Rake::Task['teaspoon:fixtures'].invoke
+ Rake::Task['teaspoon:tests'].invoke
+ end
end