summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Clamp <richardc@unixbeard.net>2017-10-11 15:19:24 +0100
committerRichard Clamp <richardc@unixbeard.net>2017-10-13 14:04:38 +0100
commit60e8347c7f9cbd689f014fa5d633ffa3276d9650 (patch)
tree0e6de164230a17a152c3f397ba3b068fefb7990e
parent5a2acfe036b4ce2c74b015101c57f040b851899c (diff)
downloadgitlab-ce-60e8347c7f9cbd689f014fa5d633ffa3276d9650.tar.gz
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
-rw-r--r--qa/qa.rb5
-rw-r--r--qa/qa/scenario/entrypoint.rb29
-rw-r--r--qa/qa/scenario/test/instance.rb16
-rw-r--r--qa/qa/scenario/test/integration/mattermost.rb19
-rw-r--r--qa/qa/specs/config.rb8
-rw-r--r--qa/qa/specs/features/mattermost/group_create_spec.rb16
6 files changed, 78 insertions, 15 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index eb6f922d0d3..59d9dd131c2 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -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
##
diff --git a/qa/qa/scenario/entrypoint.rb b/qa/qa/scenario/entrypoint.rb
new file mode 100644
index 00000000000..b47fae2604c
--- /dev/null
+++ b/qa/qa/scenario/entrypoint.rb
@@ -0,0 +1,29 @@
+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
diff --git a/qa/qa/scenario/test/instance.rb b/qa/qa/scenario/test/instance.rb
index 689292bc60b..115462d8e6b 100644
--- a/qa/qa/scenario/test/instance.rb
+++ b/qa/qa/scenario/test/instance.rb
@@ -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
diff --git a/qa/qa/scenario/test/integration/mattermost.rb b/qa/qa/scenario/test/integration/mattermost.rb
new file mode 100644
index 00000000000..be371cca6ff
--- /dev/null
+++ b/qa/qa/scenario/test/integration/mattermost.rb
@@ -0,0 +1,19 @@
+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
diff --git a/qa/qa/specs/config.rb b/qa/qa/specs/config.rb
index 79c681168cc..bff8c974047 100644
--- a/qa/qa/specs/config.rb
+++ b/qa/qa/specs/config.rb
@@ -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
diff --git a/qa/qa/specs/features/mattermost/group_create_spec.rb b/qa/qa/specs/features/mattermost/group_create_spec.rb
new file mode 100644
index 00000000000..f05eee2337b
--- /dev/null
+++ b/qa/qa/specs/features/mattermost/group_create_spec.rb
@@ -0,0 +1,16 @@
+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