From 4d9c76e9e44119ee2578c94b2b98bb72e80e874b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 18 Apr 2019 22:08:04 +0200 Subject: Reorganize test jobs by level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- lib/tasks/spec.rake | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'lib/tasks/spec.rake') diff --git a/lib/tasks/spec.rake b/lib/tasks/spec.rake index 2eddcb3c777..c881ad4cf12 100644 --- a/lib/tasks/spec.rake +++ b/lib/tasks/spec.rake @@ -1,7 +1,32 @@ +# frozen_string_literal: true + +return if Rails.env.production? + Rake::Task["spec"].clear if Rake::Task.task_defined?('spec') namespace :spec do - desc 'GitLab | Rspec | Run request specs' + desc 'GitLab | RSpec | Run unit tests' + RSpec::Core::RakeTask.new(:unit, :rspec_opts) do |t, args| + require_dependency 'quality/test_level' + t.pattern = Quality::TestLevel.new.pattern(:unit) + t.rspec_opts = args[:rspec_opts] + end + + desc 'GitLab | RSpec | Run integration tests' + RSpec::Core::RakeTask.new(:integration, :rspec_opts) do |t, args| + require_dependency 'quality/test_level' + t.pattern = Quality::TestLevel.new.pattern(:integration) + t.rspec_opts = args[:rspec_opts] + end + + desc 'GitLab | RSpec | Run system tests' + RSpec::Core::RakeTask.new(:system, :rspec_opts) do |t, args| + require_dependency 'quality/test_level' + t.pattern = Quality::TestLevel.new.pattern(:system) + t.rspec_opts = args[:rspec_opts] + end + + desc '[Deprecated] Use the "bin/rspec --tag api" instead' task :api do cmds = [ %w(rake gitlab:setup), @@ -10,7 +35,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run feature specs' + desc '[Deprecated] Use the "spec:system" task instead' task :feature do cmds = [ %w(rake gitlab:setup), @@ -19,7 +44,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run model specs' + desc '[Deprecated] Use "bin/rspec spec/models" instead' task :models do cmds = [ %w(rake gitlab:setup), @@ -28,7 +53,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run service specs' + desc '[Deprecated] Use "bin/rspec spec/services" instead' task :services do cmds = [ %w(rake gitlab:setup), @@ -37,7 +62,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run lib specs' + desc '[Deprecated] Use "bin/rspec spec/lib" instead' task :lib do cmds = [ %w(rake gitlab:setup), @@ -45,15 +70,6 @@ namespace :spec do ] run_commands(cmds) end - - desc 'GitLab | Rspec | Run other specs' - task :other do - cmds = [ - %w(rake gitlab:setup), - %w(rspec spec --tag ~@api --tag ~@feature --tag ~@models --tag ~@lib --tag ~@services) - ] - run_commands(cmds) - end end desc "GitLab | Run specs" -- cgit v1.2.1 From 4f20c9de6f8e09131d751174243214d9bd3b6419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Wed, 22 May 2019 11:45:46 +0000 Subject: Revert "Merge branch 'reorganize-tests-jobs-by-level' into 'master'" This reverts merge request !27514 --- lib/tasks/spec.rake | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) (limited to 'lib/tasks/spec.rake') diff --git a/lib/tasks/spec.rake b/lib/tasks/spec.rake index c881ad4cf12..2eddcb3c777 100644 --- a/lib/tasks/spec.rake +++ b/lib/tasks/spec.rake @@ -1,32 +1,7 @@ -# frozen_string_literal: true - -return if Rails.env.production? - Rake::Task["spec"].clear if Rake::Task.task_defined?('spec') namespace :spec do - desc 'GitLab | RSpec | Run unit tests' - RSpec::Core::RakeTask.new(:unit, :rspec_opts) do |t, args| - require_dependency 'quality/test_level' - t.pattern = Quality::TestLevel.new.pattern(:unit) - t.rspec_opts = args[:rspec_opts] - end - - desc 'GitLab | RSpec | Run integration tests' - RSpec::Core::RakeTask.new(:integration, :rspec_opts) do |t, args| - require_dependency 'quality/test_level' - t.pattern = Quality::TestLevel.new.pattern(:integration) - t.rspec_opts = args[:rspec_opts] - end - - desc 'GitLab | RSpec | Run system tests' - RSpec::Core::RakeTask.new(:system, :rspec_opts) do |t, args| - require_dependency 'quality/test_level' - t.pattern = Quality::TestLevel.new.pattern(:system) - t.rspec_opts = args[:rspec_opts] - end - - desc '[Deprecated] Use the "bin/rspec --tag api" instead' + desc 'GitLab | Rspec | Run request specs' task :api do cmds = [ %w(rake gitlab:setup), @@ -35,7 +10,7 @@ namespace :spec do run_commands(cmds) end - desc '[Deprecated] Use the "spec:system" task instead' + desc 'GitLab | Rspec | Run feature specs' task :feature do cmds = [ %w(rake gitlab:setup), @@ -44,7 +19,7 @@ namespace :spec do run_commands(cmds) end - desc '[Deprecated] Use "bin/rspec spec/models" instead' + desc 'GitLab | Rspec | Run model specs' task :models do cmds = [ %w(rake gitlab:setup), @@ -53,7 +28,7 @@ namespace :spec do run_commands(cmds) end - desc '[Deprecated] Use "bin/rspec spec/services" instead' + desc 'GitLab | Rspec | Run service specs' task :services do cmds = [ %w(rake gitlab:setup), @@ -62,7 +37,7 @@ namespace :spec do run_commands(cmds) end - desc '[Deprecated] Use "bin/rspec spec/lib" instead' + desc 'GitLab | Rspec | Run lib specs' task :lib do cmds = [ %w(rake gitlab:setup), @@ -70,6 +45,15 @@ namespace :spec do ] run_commands(cmds) end + + desc 'GitLab | Rspec | Run other specs' + task :other do + cmds = [ + %w(rake gitlab:setup), + %w(rspec spec --tag ~@api --tag ~@feature --tag ~@models --tag ~@lib --tag ~@services) + ] + run_commands(cmds) + end end desc "GitLab | Run specs" -- cgit v1.2.1 From 6145ddf515f93fcc7ed873b911b6369cc2bc0462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 22 May 2019 14:16:49 +0200 Subject: Revert "Merge branch 'revert-04c3c6dd' into 'master'" This reverts commit 744f1f2e7037f5c70c3168d9e2e89b1c327465d2, reversing changes made to c4d930e5f54e7da07c80cc028dfc0f5c08719146. --- lib/tasks/spec.rake | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'lib/tasks/spec.rake') diff --git a/lib/tasks/spec.rake b/lib/tasks/spec.rake index 2eddcb3c777..c881ad4cf12 100644 --- a/lib/tasks/spec.rake +++ b/lib/tasks/spec.rake @@ -1,7 +1,32 @@ +# frozen_string_literal: true + +return if Rails.env.production? + Rake::Task["spec"].clear if Rake::Task.task_defined?('spec') namespace :spec do - desc 'GitLab | Rspec | Run request specs' + desc 'GitLab | RSpec | Run unit tests' + RSpec::Core::RakeTask.new(:unit, :rspec_opts) do |t, args| + require_dependency 'quality/test_level' + t.pattern = Quality::TestLevel.new.pattern(:unit) + t.rspec_opts = args[:rspec_opts] + end + + desc 'GitLab | RSpec | Run integration tests' + RSpec::Core::RakeTask.new(:integration, :rspec_opts) do |t, args| + require_dependency 'quality/test_level' + t.pattern = Quality::TestLevel.new.pattern(:integration) + t.rspec_opts = args[:rspec_opts] + end + + desc 'GitLab | RSpec | Run system tests' + RSpec::Core::RakeTask.new(:system, :rspec_opts) do |t, args| + require_dependency 'quality/test_level' + t.pattern = Quality::TestLevel.new.pattern(:system) + t.rspec_opts = args[:rspec_opts] + end + + desc '[Deprecated] Use the "bin/rspec --tag api" instead' task :api do cmds = [ %w(rake gitlab:setup), @@ -10,7 +35,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run feature specs' + desc '[Deprecated] Use the "spec:system" task instead' task :feature do cmds = [ %w(rake gitlab:setup), @@ -19,7 +44,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run model specs' + desc '[Deprecated] Use "bin/rspec spec/models" instead' task :models do cmds = [ %w(rake gitlab:setup), @@ -28,7 +53,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run service specs' + desc '[Deprecated] Use "bin/rspec spec/services" instead' task :services do cmds = [ %w(rake gitlab:setup), @@ -37,7 +62,7 @@ namespace :spec do run_commands(cmds) end - desc 'GitLab | Rspec | Run lib specs' + desc '[Deprecated] Use "bin/rspec spec/lib" instead' task :lib do cmds = [ %w(rake gitlab:setup), @@ -45,15 +70,6 @@ namespace :spec do ] run_commands(cmds) end - - desc 'GitLab | Rspec | Run other specs' - task :other do - cmds = [ - %w(rake gitlab:setup), - %w(rspec spec --tag ~@api --tag ~@feature --tag ~@models --tag ~@lib --tag ~@services) - ] - run_commands(cmds) - end end desc "GitLab | Run specs" -- cgit v1.2.1