Skip to content

Commit

Permalink
Merge pull request #9517 from eduardoj/beta-feature-tests
Browse files Browse the repository at this point in the history
Introduce feature beta tests
  • Loading branch information
hennevogel committed May 12, 2020
2 parents 90e26d9 + bdf2596 commit 1fc5fa4
Show file tree
Hide file tree
Showing 50 changed files with 8,963 additions and 2,082 deletions.
14 changes: 10 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- .

rspec:
parallelism: 4
parallelism: 5
docker:
- <<: *frontend_base
- <<: *mariadb
Expand All @@ -105,9 +105,15 @@ jobs:
cd src/api
pickfile=log/pick.$CIRCLE_NODE_INDEX.list
# single out db specs
circleci tests glob 'spec/**/*_spec.rb' | grep -v 'spec/db/' > spec.list
circleci tests split --total $CIRCLE_NODE_TOTAL --split-by=timings < spec.list > $pickfile
# reserve the latest node for beta
if test "$CIRCLE_NODE_INDEX" = $((CIRCLE_NODE_TOTAL-1)); then
echo "Testing beta"
circleci tests glob 'spec/features/beta/**/*_spec.rb' > $pickfile
else
# single out beta and db specs
circleci tests glob 'spec/**/*_spec.rb' | grep -v 'spec/\(features/beta\|db\)' > spec.list
circleci tests split --total $((CIRCLE_NODE_TOTAL-1)) --split-by=timings < spec.list > $pickfile
fi
bundle exec rspec --format progress --format RspecJunitFormatter -o /home/frontend/rspec/rspec.xml $(cat $pickfile)
Expand Down
87 changes: 36 additions & 51 deletions src/api/.rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude`
# on 2020-04-23 09:45:06 +0000 using RuboCop version 0.82.0.
# on 2020-05-07 15:26:54 +0000 using RuboCop version 0.82.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 10
# Offense count: 20
# Cop supports --auto-correct.
Capybara/CurrentPathExpectation:
Exclude:
- 'spec/features/beta/webui/packages_spec.rb'
- 'spec/features/beta/webui/projects_spec.rb'
- 'spec/features/webui/packages_spec.rb'
- 'spec/features/webui/projects_spec.rb'

# Offense count: 152
# Offense count: 304
# Cop supports --auto-correct.
# Configuration parameters: EnabledMethods.
Capybara/FeatureMethods:
Enabled: false

# Offense count: 89
# Offense count: 97
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Expand All @@ -39,7 +41,7 @@ Layout/EmptyComment:
- 'app/models/bs_request_action_maintenance_release.rb'
- 'app/models/bs_request_action_set_bugowner.rb'

# Offense count: 584
# Offense count: 585
# Cop supports --auto-correct.
Layout/EmptyLineAfterGuardClause:
Enabled: false
Expand Down Expand Up @@ -166,7 +168,7 @@ Lint/UriRegexp:
Exclude:
- 'app/models/kiwi/repository.rb'

# Offense count: 882
# Offense count: 885
# Configuration parameters: IgnoredMethods.
Metrics/AbcSize:
Max: 202
Expand All @@ -190,17 +192,17 @@ Metrics/BlockNesting:
- 'lib/xpath_engine.rb'
- 'test/node_matcher.rb'

# Offense count: 83
# Offense count: 84
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 885

# Offense count: 221
# Offense count: 222
# Configuration parameters: IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 45

# Offense count: 931
# Offense count: 932
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 227
Expand Down Expand Up @@ -318,7 +320,7 @@ Naming/PredicateName:
- 'app/models/user.rb'
- 'app/models/user_ldap_strategy.rb'

# Offense count: 61
# Offense count: 64
RSpec/AnyInstance:
Enabled: false

Expand All @@ -330,34 +332,32 @@ RSpec/BeforeAfterAll:
- 'spec/support/**/*.rb'
- 'spec/models/relationship_spec.rb'

# Offense count: 719
# Offense count: 743
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false

# Offense count: 5
# Offense count: 3
RSpec/DescribeClass:
Exclude:
- 'spec/routing/api_matcher_spec.rb'
- 'spec/routing/source/key_info_spec.rb'
- 'spec/routing/webui/projects/public_key_spec.rb'
- 'spec/routing/webui/projects/ssl_certificate_spec.rb'
- 'spec/routing/webui_matcher_spec.rb'

# Offense count: 408
# Offense count: 412
# Cop supports --auto-correct.
# Configuration parameters: SkipBlocks, EnforcedStyle.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Enabled: false

# Offense count: 122
# Offense count: 130
# Cop supports --auto-correct.
RSpec/EmptyLineAfterFinalLet:
Enabled: false

# Offense count: 208
# Offense count: 312
# Configuration parameters: Max.
RSpec/ExampleLength:
Enabled: false
Expand Down Expand Up @@ -385,10 +385,11 @@ RSpec/ExpectActual:
- 'spec/controllers/webui/webui_controller_spec.rb'
- 'spec/helpers/webui/webui_helper_spec.rb'

# Offense count: 3
# Offense count: 4
RSpec/ExpectInHook:
Exclude:
- 'spec/controllers/webui/project_controller_spec.rb'
- 'spec/features/beta/webui/projects_spec.rb'
- 'spec/features/webui/projects_spec.rb'

# Offense count: 45
Expand Down Expand Up @@ -428,12 +429,12 @@ RSpec/IteratedExpectation:
Exclude:
- 'spec/models/user_spec.rb'

# Offense count: 259
# Offense count: 262
# Cop supports --auto-correct.
RSpec/LeadingSubject:
Enabled: false

# Offense count: 348
# Offense count: 372
RSpec/LetSetup:
Enabled: false

Expand All @@ -446,21 +447,20 @@ RSpec/MessageSpies:
- 'spec/controllers/webui/project_controller_spec.rb'
- 'spec/models/kiwi/image_spec.rb'

# Offense count: 273
# Configuration parameters: AggregateFailuresByDefault.
# Offense count: 284
RSpec/MultipleExpectations:
Max: 12

# Offense count: 832
# Offense count: 833
# Configuration parameters: IgnoreSharedExamples.
RSpec/NamedSubject:
Enabled: false

# Offense count: 423
# Offense count: 427
RSpec/NestedGroups:
Max: 7

# Offense count: 49
# Offense count: 47
# Cop supports --auto-correct.
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
# SupportedStyles: inflected, explicit
Expand All @@ -471,7 +471,6 @@ RSpec/PredicateMatcher:
- 'spec/models/backend/file_spec.rb'
- 'spec/models/cloud/backend/upload_job_spec.rb'
- 'spec/models/cloud/upload_job_spec.rb'
- 'spec/models/event_subscription/generate_hash_for_subscriber_spec.rb'
- 'spec/models/kiwi/image_spec.rb'
- 'spec/models/project_spec.rb'
- 'spec/models/review_spec.rb'
Expand Down Expand Up @@ -506,6 +505,7 @@ RSpec/RepeatedExampleGroupDescription:
- 'spec/policies/user_policy_spec.rb'

# Offense count: 9
# Cop supports --auto-correct.
RSpec/ScatteredLet:
Exclude:
- 'spec/controllers/webui/patchinfo_controller_spec.rb'
Expand All @@ -525,27 +525,12 @@ RSpec/SubjectStub:
Exclude:
- 'spec/models/kiwi/image_spec.rb'

# Offense count: 33
# Offense count: 34
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/controllers/webui/session_controller_spec.rb'
- 'spec/features/webui/login_spec.rb'
- 'spec/jobs/issue_tracker_fetch_issues_job_spec.rb'
- 'spec/jobs/issue_tracker_update_issues_job_spec.rb'
- 'spec/lib/authenticator_spec.rb'
- 'spec/lib/backend/connection_helper_spec.rb'
- 'spec/mixins/build_log_support_spec.rb'
- 'spec/mixins/parse_package_diff_spec.rb'
- 'spec/models/issue_tracker_spec.rb'
- 'spec/models/project_spec.rb'
- 'spec/models/user_ldap_strategy_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/support/shared_contexts/a_kerberos_mock.rb'
- 'spec/support/shared_contexts/setup_ldap_mock.rb'
- 'spec/support/shared_examples/a_ldap_connection.rb'
Enabled: false

# Offense count: 41
# Offense count: 43
# Cop supports --auto-correct.
Rails/ActiveRecordAliases:
Enabled: false
Expand Down Expand Up @@ -721,7 +706,7 @@ Rails/SkipsModelValidations:
- 'spec/models/bs_request_action_spec.rb'
- 'spec/models/review_spec.rb'

# Offense count: 86
# Offense count: 88
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: strict, flexible
Expand Down Expand Up @@ -765,11 +750,11 @@ Style/CommentedKeyword:
Style/ConditionalAssignment:
Enabled: false

# Offense count: 790
# Offense count: 800
Style/Documentation:
Enabled: false

# Offense count: 1317
# Offense count: 1359
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Expand Down Expand Up @@ -828,7 +813,7 @@ Style/NumericPredicate:
Style/RedundantReturn:
Enabled: false

# Offense count: 91
# Offense count: 92
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Expand Down Expand Up @@ -857,21 +842,21 @@ Style/StringLiterals:
Exclude:
- 'config/initializers/inflector.rb'

# Offense count: 362
# Offense count: 367
# Cop supports --auto-correct.
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 253
# Offense count: 262
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, MinSize, WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
Enabled: false

# Offense count: 9166
# Offense count: 9546
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Expand Down
3 changes: 2 additions & 1 deletion src/api/spec/browser_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# helper methods for authentication in features tests
require 'support/features/features_authentication'
require 'support/features/features_attribute'
require 'support/features/features_beta'

# Shared examples. Per recommendation of RSpec,
# https://www.relishapp.com/rspec/rspec-core/v/2-12/docs/example-groups/shared-examples
Dir['./spec/support/shared_examples/features/*.rb'].sort.each { |example| require example }
Dir['./spec/support/shared_examples/features/**/*.rb'].sort.each { |example| require example }
Loading

0 comments on commit 1fc5fa4

Please sign in to comment.