summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorJames Edwards-Jones <jamedjo@gmail.com>2017-02-06 15:12:27 +0000
committerJames Edwards-Jones <jamedjo@gmail.com>2017-02-06 15:12:27 +0000
commitb988faaf85c8e68d501f242b980e5e79a00e2b15 (patch)
treefaffbfe623bfcbfe1c09bddac00b2cc879baff63 /lib/tasks
parent5af4cae544c8526de63e639bd6c7db730526add3 (diff)
parent53db7d1d75e1d14cb20278bd0c1a75ce24a6626d (diff)
downloadgitlab-ce-b988faaf85c8e68d501f242b980e5e79a00e2b15.tar.gz
Merge branch 'master' into 'jej-pages-to-ce'jej-pages-to-ce
# Conflicts: # db/schema.rb
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/assets.rake1
-rw-r--r--lib/tasks/gitlab/test.rake2
-rw-r--r--lib/tasks/karma.rake25
-rw-r--r--lib/tasks/teaspoon.rake25
-rw-r--r--lib/tasks/test.rake2
5 files changed, 28 insertions, 27 deletions
diff --git a/lib/tasks/gitlab/assets.rake b/lib/tasks/gitlab/assets.rake
index 5d884bf9f66..b6ef8260191 100644
--- a/lib/tasks/gitlab/assets.rake
+++ b/lib/tasks/gitlab/assets.rake
@@ -3,6 +3,7 @@ namespace :gitlab do
desc 'GitLab | Assets | Compile all frontend assets'
task :compile do
Rake::Task['assets:precompile'].invoke
+ Rake::Task['webpack:compile'].invoke
Rake::Task['gitlab:assets:fix_urls'].invoke
end
diff --git a/lib/tasks/gitlab/test.rake b/lib/tasks/gitlab/test.rake
index 4d4e746503a..84810b489ce 100644
--- a/lib/tasks/gitlab/test.rake
+++ b/lib/tasks/gitlab/test.rake
@@ -6,7 +6,7 @@ namespace :gitlab do
%W(rake rubocop),
%W(rake spinach),
%W(rake spec),
- %W(rake teaspoon)
+ %W(rake karma)
]
cmds.each do |cmd|
diff --git a/lib/tasks/karma.rake b/lib/tasks/karma.rake
new file mode 100644
index 00000000000..89812a179ec
--- /dev/null
+++ b/lib/tasks/karma.rake
@@ -0,0 +1,25 @@
+unless Rails.env.production?
+ Rake::Task['karma'].clear if Rake::Task.task_defined?('karma')
+
+ namespace :karma do
+ desc 'GitLab | Karma | 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 | Karma | Run JavaScript tests'
+ task :tests do
+ sh "npm run karma" do |ok, res|
+ abort('rake karma:tests failed') unless ok
+ end
+ end
+ end
+
+ desc 'GitLab | Karma | Shortcut for karma:fixtures and karma:tests'
+ task :karma do
+ Rake::Task['karma:fixtures'].invoke
+ Rake::Task['karma:tests'].invoke
+ end
+end
diff --git a/lib/tasks/teaspoon.rake b/lib/tasks/teaspoon.rake
deleted file mode 100644
index 08caedd7ff3..00000000000
--- a/lib/tasks/teaspoon.rake
+++ /dev/null
@@ -1,25 +0,0 @@
-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
-
- 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
-
- 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
diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake
index d3dcbd2c29b..3e01f91d32c 100644
--- a/lib/tasks/test.rake
+++ b/lib/tasks/test.rake
@@ -7,5 +7,5 @@ end
unless Rails.env.production?
desc "GitLab | Run all tests on CI with simplecov"
- task test_ci: [:rubocop, :brakeman, :teaspoon, :spinach, :spec]
+ task test_ci: [:rubocop, :brakeman, :karma, :spinach, :spec]
end