summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2019-07-17 17:17:37 -0500
committerMike Greiling <mike@pixelcog.com>2019-07-19 02:27:14 -0500
commitfaa17d526371a34325705b8de9594e4e9df03298 (patch)
tree80cdc2603cb0e1da0edcd9310a812b64b630a08e /lib/tasks
parent25fa78e2f9205427274772ff620d59cc9162400c (diff)
downloadgitlab-ce-faa17d526371a34325705b8de9594e4e9df03298.tar.gz
Rename the karma:fixtures task
Introduces frontend:fixtures rake task to replace karma:fixtures and update documentation and CI scripts to match
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/frontend.rake21
-rw-r--r--lib/tasks/karma.rake11
2 files changed, 23 insertions, 9 deletions
diff --git a/lib/tasks/frontend.rake b/lib/tasks/frontend.rake
new file mode 100644
index 00000000000..e1f23bfa06e
--- /dev/null
+++ b/lib/tasks/frontend.rake
@@ -0,0 +1,21 @@
+unless Rails.env.production?
+ namespace :frontend do
+ desc 'GitLab | Frontend | Generate fixtures for JavaScript tests'
+ RSpec::Core::RakeTask.new(:fixtures, [:pattern]) do |t, args|
+ args.with_defaults(pattern: '{spec,ee/spec}/javascripts/fixtures/*.rb')
+ ENV['NO_KNAPSACK'] = 'true'
+ t.pattern = args[:pattern]
+ t.rspec_opts = '--format documentation'
+ end
+
+ desc 'GitLab | Frontend | Run JavaScript tests'
+ task tests: ['yarn:check'] do
+ sh "yarn test" do |ok, res|
+ abort('rake frontend:tests failed') unless ok
+ end
+ end
+ end
+
+ desc 'GitLab | Frontend | Shortcut for frontend:fixtures and frontend:tests'
+ task frontend: ['frontend:fixtures', 'frontend:tests']
+end
diff --git a/lib/tasks/karma.rake b/lib/tasks/karma.rake
index 2dc14183fa3..36590010406 100644
--- a/lib/tasks/karma.rake
+++ b/lib/tasks/karma.rake
@@ -1,15 +1,8 @@
unless Rails.env.production?
namespace :karma do
+ # alias exists for legacy reasons
desc 'GitLab | Karma | Generate fixtures for JavaScript tests'
- task fixtures: ['karma:rspec_fixtures']
-
- desc 'GitLab | Karma | Generate fixtures using RSpec'
- RSpec::Core::RakeTask.new(:rspec_fixtures, [:pattern]) do |t, args|
- args.with_defaults(pattern: '{spec,ee/spec}/javascripts/fixtures/*.rb')
- ENV['NO_KNAPSACK'] = 'true'
- t.pattern = args[:pattern]
- t.rspec_opts = '--format documentation'
- end
+ task fixtures: ['frontend:fixtures']
desc 'GitLab | Karma | Run JavaScript tests'
task tests: ['yarn:check'] do