Commit 60e8347c authored by Richard Clamp's avatar Richard Clamp

Add Test::Integration::Mattermost

Here we add a new entrypoint for the test suite,
Test::Integration::Mattermost.  It is to ensure that mattermost
integration is working when enabling the embedded mattermost of
gitlab-omnibus

It runs all the example groups from Test::Instance, in addition to any
groups tagged :mattermost

* Extracts a common entrypoint class from Test::Instance as
  Scenario::Entrypoint, and uses that as the base for Test::Instance and
  Test::Integration::Mattermost

* RSpec groups defined in `specs/features/mattermost/**_spec.rb` are
  tagged with :mattermost so they can be filtered out of the default
  run.

* Tests tagged :mattermost are filtered out by default, and are
  un-filtered by Test::Integration::Mattermost
parent 5a2acfe0
......@@ -18,6 +18,7 @@ module QA
# Support files
#
autoload :Actable, 'qa/scenario/actable'
autoload :Entrypoint, 'qa/scenario/entrypoint'
autoload :Template, 'qa/scenario/template'
##
......@@ -25,6 +26,10 @@ module QA
#
module Test
autoload :Instance, 'qa/scenario/test/instance'
module Integration
autoload :Mattermost, 'qa/scenario/test/integration/mattermost'
end
end
##
......
module QA
module Scenario
##
# Run test suite against any Gitlab instance,
# including staging and on-premises installation.
#
class Entrypoint < Template
def perform(address, *files)
Specs::Config.perform do |specs|
specs.address = address
configure_specs(specs)
end
##
# Perform before hooks, which are different for CE and EE
#
Runtime::Release.perform_before_hooks
Specs::Runner.perform do |specs|
specs.rspec('--tty', files.any? ? files : 'qa/specs/features')
end
end
protected
def configure_specs(specs) end
end
end
end
......@@ -5,21 +5,7 @@ module QA
# Run test suite against any GitLab instance,
# including staging and on-premises installation.
#
class Instance < Scenario::Template
def perform(address, *files)
Specs::Config.perform do |specs|
specs.address = address
end
##
# Perform before hooks, which are different for CE and EE
#
Runtime::Release.perform_before_hooks
Specs::Runner.perform do |specs|
specs.rspec('--tty', files.any? ? files : 'qa/specs/features')
end
end
class Instance < Entrypoint
end
end
end
......
module QA
module Scenario
module Test
module Integration
##
# Run test suite against any GitLab instance where mattermost is enabled,
# including staging and on-premises installation.
#
class Mattermost < Scenario::Entrypoint
protected
def configure_specs(specs)
specs.exclusion_filter[:mattermost] = false
end
end
end
end
end
end
......@@ -10,9 +10,11 @@ module QA
module Specs
class Config < Scenario::Template
attr_writer :address
attr_accessor :exclusion_filter
def initialize
@address = ENV['GITLAB_URL']
@exclusion_filter = { mattermost: true }
end
def perform
......@@ -32,6 +34,12 @@ module QA
mocks.verify_partial_doubles = true
end
config.exclusion_filter = @exclusion_filter
config.define_derived_metadata(file_path: %r{/specs/features/mattermost/}) do |metadata|
metadata[:mattermost] = true
end
config.order = :random
Kernel.srand config.seed
config.formatter = :documentation
......
module QA
feature 'create a new group' do
scenario 'creating a group with a mattermost team' do
Page::Main::Entry.act { sign_in_using_credentials }
Page::Main::Menu.act { go_to_groups }
Page::Dashboard::Groups.perform do |page|
page.go_to_new_group
expect(page).to have_content(
/Create a Mattermost team for this group/
)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment