From 6dc5dab7d72d609faf415c4537bf26b1e8fce3e8 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 10 Nov 2017 09:39:34 +0100 Subject: Configure RSpec from within RSpec runner class --- qa/qa/scenario/entrypoint.rb | 1 - qa/qa/specs/config.rb | 3 --- qa/qa/specs/runner.rb | 16 +++++++--------- 3 files changed, 7 insertions(+), 13 deletions(-) (limited to 'qa') diff --git a/qa/qa/scenario/entrypoint.rb b/qa/qa/scenario/entrypoint.rb index a6a7120aed8..db51a7365f5 100644 --- a/qa/qa/scenario/entrypoint.rb +++ b/qa/qa/scenario/entrypoint.rb @@ -9,7 +9,6 @@ module QA def perform(address, *files) Runtime::Scenario.define(:gitlab_address, address) - Specs::Config.perform ## # Perform before hooks, which are different for CE and EE diff --git a/qa/qa/specs/config.rb b/qa/qa/specs/config.rb index b1b8d9a3ca8..591ddde8ab9 100644 --- a/qa/qa/specs/config.rb +++ b/qa/qa/specs/config.rb @@ -9,8 +9,6 @@ require 'selenium-webdriver' module QA module Specs class Config < Scenario::Template - attr_writer :address - def perform configure_rspec! configure_capybara! @@ -50,7 +48,6 @@ module QA end Capybara.configure do |config| - # config.app_host = @address config.default_driver = :chrome config.javascript_driver = :chrome config.default_max_wait_time = 4 diff --git a/qa/qa/specs/runner.rb b/qa/qa/specs/runner.rb index 2aa18d5d3a1..3cfe52b350c 100644 --- a/qa/qa/specs/runner.rb +++ b/qa/qa/specs/runner.rb @@ -2,16 +2,14 @@ require 'rspec/core' module QA module Specs - class Runner - include Scenario::Actable - - def rspec(tty: false, tags: [], files: ['qa/specs/features']) + class Runner < Scenario::Template + def perform(tty: false, tags: [], files: ['qa/specs/features']) args = [] - args << '--tty' if tty - tags.to_a.each do |tag| - args << ['-t', tag.to_s] - end - args << files + args.push('--tty') if tty + tags.to_a.each { |tag| args.push(['-t', tag.to_s]) } + args.push(files) + + Specs::Config.perform RSpec::Core::Runner.run(args.flatten, $stderr, $stdout).tap do |status| abort if status.nonzero? -- cgit v1.2.3