summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-10-31 08:14:57 +0000
committerRémy Coutable <remy@rymai.me>2016-10-31 08:14:57 +0000
commit837369878a4a6f1b5e4bf44285e9ced0983ee6b1 (patch)
treefa1e1262221f1372c621c28c5f9d088d904e7d1b
parentb216d9bf85388e34891e392d8c80e72643d639c0 (diff)
parent8a9c7b1e04461f3dffa156a56bc25e77eda2fd9c (diff)
downloadgitlab-ce-837369878a4a6f1b5e4bf44285e9ced0983ee6b1.tar.gz
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
-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