Commit 92c15ec2 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'resolve-new-qa-differences' into 'master'

Fix CE to EE differences in the qa/ directory

See merge request gitlab-org/gitlab-ce!32354
parents b557145a e84398ba
...@@ -83,3 +83,5 @@ module QA ...@@ -83,3 +83,5 @@ module QA
end end
end end
end end
QA::Page::Admin::Menu.prepend_if_ee('QA::EE::Page::Admin::Menu')
...@@ -29,3 +29,5 @@ module QA ...@@ -29,3 +29,5 @@ module QA
end end
end end
end end
QA::Page::Dashboard::Projects.prepend_if_ee('QA::EE::Page::Dashboard::Projects')
...@@ -32,3 +32,5 @@ module QA ...@@ -32,3 +32,5 @@ module QA
end end
end end
end end
QA::Page::File::Show.prepend_if_ee('QA::EE::Page::File::Show')
...@@ -187,3 +187,5 @@ module QA ...@@ -187,3 +187,5 @@ module QA
end end
end end
end end
QA::Page::MergeRequest::Show.prepend_if_ee('QA::EE::Page::MergeRequest::Show')
...@@ -34,3 +34,5 @@ module QA ...@@ -34,3 +34,5 @@ module QA
end end
end end
end end
QA::Page::Profile::Menu.prepend_if_ee('QA::EE::Page::Profile::Menu')
...@@ -25,3 +25,5 @@ module QA ...@@ -25,3 +25,5 @@ module QA
end end
end end
end end
QA::Page::Project::Issue::Index.prepend_if_ee('QA::EE::Page::Project::Issue::Index')
...@@ -112,3 +112,5 @@ module QA ...@@ -112,3 +112,5 @@ module QA
end end
end end
end end
QA::Page::Project::Issue::Show.prepend_if_ee('QA::EE::Page::Project::Issue::Show')
...@@ -39,3 +39,5 @@ module QA ...@@ -39,3 +39,5 @@ module QA
end end
end end
end end
QA::Page::Project::Menu.prepend_if_ee('QA::EE::Page::Project::SubMenus::SecurityCompliance')
...@@ -73,3 +73,5 @@ module QA ...@@ -73,3 +73,5 @@ module QA
end end
end end
end end
QA::Page::Project::New.prepend_if_ee('QA::EE::Page::Project::New')
...@@ -53,3 +53,5 @@ module QA ...@@ -53,3 +53,5 @@ module QA
end end
end end
end end
QA::Page::Project::Operations::Kubernetes::Show.prepend_if_ee('QA::EE::Page::Project::Operations::Kubernetes::Show')
...@@ -60,3 +60,5 @@ module QA::Page ...@@ -60,3 +60,5 @@ module QA::Page
end end
end end
end end
QA::Page::Project::Pipeline::Show.prepend_if_ee('QA::EE::Page::Project::Pipeline::Show')
...@@ -41,3 +41,5 @@ module QA ...@@ -41,3 +41,5 @@ module QA
end end
end end
end end
QA::Page::Project::Settings::Main.prepend_if_ee('QA::EE::Page::Project::Settings::Main')
...@@ -89,3 +89,5 @@ module QA ...@@ -89,3 +89,5 @@ module QA
end end
end end
end end
QA::Page::Project::Settings::MirroringRepositories.prepend_if_ee('QA::EE::Page::Project::Settings::MirroringRepositories')
...@@ -73,3 +73,5 @@ module QA ...@@ -73,3 +73,5 @@ module QA
end end
end end
end end
QA::Page::Project::Settings::ProtectedBranches.prepend_if_ee('QA::EE::Page::Project::Settings::ProtectedBranches')
...@@ -131,3 +131,5 @@ module QA ...@@ -131,3 +131,5 @@ module QA
end end
end end
end end
QA::Page::Project.prepend_if_ee('QA::EE::Page::Project::Show')
...@@ -233,3 +233,5 @@ module QA ...@@ -233,3 +233,5 @@ module QA
end end
end end
end end
QA::Runtime::Env.extend_if_ee('QA::EE::Runtime::Env')
...@@ -56,3 +56,5 @@ module QA ...@@ -56,3 +56,5 @@ module QA
end end
end end
end end
QA::Scenario::Test::Sanity::Selectors.prepend_if_ee('QA::EE::Scenario::Test::Sanity::Selectors')
...@@ -24,7 +24,7 @@ module RuboCop ...@@ -24,7 +24,7 @@ module RuboCop
# We use `match?` here instead of RuboCop's AST matching, as this makes # We use `match?` here instead of RuboCop's AST matching, as this makes
# it far easier to handle nested constants such as `EE::Foo::Bar::Baz`. # it far easier to handle nested constants such as `EE::Foo::Bar::Baz`.
line.match?(/(\s|\()('|")?(::)?EE::/) line.match?(/(\s|\()('|")?(::)?(QA::)?EE::/)
end end
def on_send(node) def on_send(node)
......
...@@ -19,6 +19,15 @@ describe RuboCop::Cop::InjectEnterpriseEditionModule do ...@@ -19,6 +19,15 @@ describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE SOURCE
end end
it 'flags the use of `prepend_if_ee QA::EE` in the middle of a file' do
expect_offense(<<~SOURCE)
class Foo
prepend_if_ee 'QA::EE::Foo'
^^^^^^^^^^^^^^^^^^^^^^^^^^^ Injecting EE modules must be done on the last line of this file, outside of any class or module definitions
end
SOURCE
end
it 'does not flag the use of `prepend_if_ee EEFoo` in the middle of a file' do it 'does not flag the use of `prepend_if_ee EEFoo` in the middle of a file' do
expect_no_offenses(<<~SOURCE) expect_no_offenses(<<~SOURCE)
class Foo class Foo
...@@ -176,6 +185,16 @@ describe RuboCop::Cop::InjectEnterpriseEditionModule do ...@@ -176,6 +185,16 @@ describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE SOURCE
end end
it 'disallows the use of prepend to inject a QA::EE module' do
expect_offense(<<~SOURCE)
class Foo
end
Foo.prepend(QA::EE::Foo)
^^^^^^^^^^^^^^^^^^^^^^^^ EE modules must be injected using `include_if_ee`, `extend_if_ee`, or `prepend_if_ee`
SOURCE
end
it 'disallows the use of extend to inject an EE module' do it 'disallows the use of extend to inject an EE module' do
expect_offense(<<~SOURCE) expect_offense(<<~SOURCE)
class Foo class Foo
......
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