diff options
author | Phil Hughes <me@iamphill.com> | 2019-07-19 17:23:41 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-07-19 17:23:41 +0300 |
commit | b83a4f8327caa93b4857aacceff95d44c214702c (patch) | |
tree | 8c6d31fd41748c42b9a488aa159f98484cb583d2 /lib | |
parent | 4c30b0a1cf5ead26d20845b82ae528fcbdf98728 (diff) | |
parent | 444a3627b6d469819f33e875dc194765d6b55b8e (diff) |
Merge branch '64722-mg-export-frontend-fixtures' into 'master'
Resolve "Export frontend fixtures as pipeline artifact"
Closes #64722 and #59166
See merge request gitlab-org/gitlab-ce!30917
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/frontend.rake | 21 | ||||
-rw-r--r-- | lib/tasks/karma.rake | 11 |
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..1cac7520227 --- /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}/frontend/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 |