Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
b662e7d21d
commit
f8f619856f
3 changed files with 12 additions and 6 deletions
|
@ -93,6 +93,14 @@ rubocop:
|
||||||
script:
|
script:
|
||||||
- run_timed_command "bundle exec rubocop --parallel"
|
- run_timed_command "bundle exec rubocop --parallel"
|
||||||
|
|
||||||
|
qa:testcases:
|
||||||
|
extends:
|
||||||
|
- .static-analysis-base
|
||||||
|
- .rubocop-job-cache
|
||||||
|
- .static-analysis:rules:ee-and-foss
|
||||||
|
script:
|
||||||
|
- run_timed_command "bundle exec rubocop qa/qa/specs/features/**/* --only QA/DuplicateTestcaseLink"
|
||||||
|
|
||||||
feature-flags-usage:
|
feature-flags-usage:
|
||||||
extends:
|
extends:
|
||||||
- .static-analysis-base
|
- .static-analysis-base
|
||||||
|
|
|
@ -734,6 +734,10 @@ QA/SelectorUsage:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/rubocop/**/*_spec.rb'
|
- 'spec/rubocop/**/*_spec.rb'
|
||||||
|
|
||||||
|
QA/DuplicateTestcaseLink:
|
||||||
|
# this cop is executed in static-analysis.gitlab-ci.yml since it cannot be run in parallel
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Performance/ActiveRecordSubtransactions:
|
Performance/ActiveRecordSubtransactions:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/**/*.rb'
|
- 'spec/**/*.rb'
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../../qa_helpers'
|
|
||||||
|
|
||||||
module RuboCop
|
module RuboCop
|
||||||
module Cop
|
module Cop
|
||||||
module QA
|
module QA
|
||||||
|
@ -17,8 +15,6 @@ module RuboCop
|
||||||
# it 'some test', testcase: '(...)/quality/test_cases/1892'
|
# it 'some test', testcase: '(...)/quality/test_cases/1892'
|
||||||
# it 'another test, testcase: '(...)/quality/test_cases/1894'
|
# it 'another test, testcase: '(...)/quality/test_cases/1894'
|
||||||
class DuplicateTestcaseLink < RuboCop::Cop::Cop
|
class DuplicateTestcaseLink < RuboCop::Cop::Cop
|
||||||
include QAHelpers
|
|
||||||
|
|
||||||
MESSAGE = "Don't reuse the same testcase link in different tests. Replace one of `%s`."
|
MESSAGE = "Don't reuse the same testcase link in different tests. Replace one of `%s`."
|
||||||
|
|
||||||
@testcase_set = Set.new
|
@testcase_set = Set.new
|
||||||
|
@ -34,8 +30,6 @@ module RuboCop
|
||||||
PATTERN
|
PATTERN
|
||||||
|
|
||||||
def on_block(node)
|
def on_block(node)
|
||||||
return unless in_qa_file?(node)
|
|
||||||
|
|
||||||
duplicate_testcase_link(node) do |link|
|
duplicate_testcase_link(node) do |link|
|
||||||
break unless self.class.duplicate?(link)
|
break unless self.class.duplicate?(link)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue