Skip to content

Commit ef1c127

Browse files
yzhoubkDaniel Schmidt
andauthored
DP-1025: upgrade omniauth-cas to 3.0; add selenium web driver (#32)
* before clean up * clean up * exclud new_user_session * remove new session path * comment out rspec * rubocop correction * setup testing * rm test config * setup selenium testing * with config from TIND-QA * Add Configure from TIND-QA * add service aliases * Updated Chrome settings - Adds `--headless` - Removes shared-memory related settings and disables shm After doing this, I'm able to run the feature tests. Before adding the headless option I still had trouble with frequent Selenium Chrome crashes, but not since. In any case, those are "resolved" by running `docker compose restart selenium` and re-running the tests. * Restores shm settings -- headless is sufficient * 2. test in click_login_link_spec.rb failed, comment it out * 3. rubocop correction * 4. update rubocop.yml: fixing rubocop error during building process on github * 5. clean up commented lines --------- Co-authored-by: Daniel Schmidt <[email protected]>
1 parent f47fa99 commit ef1c127

File tree

17 files changed

+390
-60
lines changed

17 files changed

+390
-60
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ config/master.key
3232
## Environment normalization:
3333
/.bundle
3434
/vendor/bundle
35-
35+
/.local
36+
/.webdrivers
37+
/.cache
3638
# these should all be checked in to normalize the environment:
3739
# Gemfile.lock, .ruby-version, .ruby-gemset
3840

.rubocop.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ AllCops:
2121
- 'out/**/*'
2222
# Exclude vendor files in GitHub build
2323
- 'vendor/**/*'
24+
NewCops: enable
25+
SuggestExtensions: false
2426

2527
# Allow one line around block body (Layout/EmptyLines will still disallow two or more)
2628
Layout/EmptyLinesAroundBlockBody:
@@ -350,4 +352,130 @@ Metrics/ClassLength:
350352
Metrics/MethodLength:
351353
Enabled: false
352354
Metrics/BlockLength:
355+
Enabled: false
356+
357+
# enable new cops
358+
Gemspec/DevelopmentDependencies: # new in 1.44
359+
Enabled: true
360+
Layout/LineContinuationLeadingSpace: # new in 1.31
361+
Enabled: true
362+
Layout/LineContinuationSpacing: # new in 1.31
363+
Enabled: true
364+
Lint/ConstantOverwrittenInRescue: # new in 1.31
365+
Enabled: true
366+
Lint/DuplicateMagicComment: # new in 1.37
367+
Enabled: true
368+
Lint/DuplicateMatchPattern: # new in 1.50
369+
Enabled: true
370+
Lint/ItWithoutArgumentsInBlock: # new in 1.59
371+
Enabled: true
372+
Lint/LiteralAssignmentInCondition: # new in 1.58
373+
Enabled: true
374+
Lint/MixedCaseRange: # new in 1.53
375+
Enabled: true
376+
Lint/NonAtomicFileOperation: # new in 1.31
377+
Enabled: true
378+
Lint/RedundantRegexpQuantifiers: # new in 1.53
379+
Enabled: true
380+
Lint/RefinementImportMethods: # new in 1.27
381+
Enabled: true
382+
Lint/RequireRangeParentheses: # new in 1.32
383+
Enabled: true
384+
Lint/UselessRescue: # new in 1.43
385+
Enabled: true
386+
Metrics/CollectionLiteralLength: # new in 1.47
387+
Enabled: true
388+
Security/CompoundHash: # new in 1.28
389+
Enabled: true
390+
Style/ArrayIntersect: # new in 1.40
391+
Enabled: false
392+
Style/ComparableClamp: # new in 1.44
393+
Enabled: true
394+
Style/ConcatArrayLiterals: # new in 1.41
395+
Enabled: true
396+
Style/DataInheritance: # new in 1.49
397+
Enabled: true
398+
Style/DirEmpty: # new in 1.48
399+
Enabled: true
400+
Style/EmptyHeredoc: # new in 1.32
401+
Enabled: true
402+
Style/EnvHome: # new in 1.29
403+
Enabled: true
404+
Style/ExactRegexpMatch: # new in 1.51
405+
Enabled: true
406+
Style/FetchEnvVar: # new in 1.28
407+
Enabled: true
408+
Style/FileEmpty: # new in 1.48
409+
Enabled: true
410+
Style/MagicCommentFormat: # new in 1.35
411+
Enabled: true
412+
Style/MapCompactWithConditionalBlock: # new in 1.30
413+
Enabled: true
414+
Style/MapIntoArray: # new in 1.63
415+
Enabled: true
416+
Style/MapToSet: # new in 1.42
417+
Enabled: true
418+
Style/MinMaxComparison: # new in 1.42
419+
Enabled: true
420+
Style/ObjectThen: # new in 1.28
421+
Enabled: true
422+
Style/OperatorMethodCall: # new in 1.37
423+
Enabled: true
424+
Style/RedundantArrayConstructor: # new in 1.52
425+
Enabled: true
426+
Style/RedundantConstantBase: # new in 1.40
427+
Enabled: true
428+
Style/RedundantCurrentDirectoryInPath: # new in 1.53
429+
Enabled: true
430+
Style/RedundantDoubleSplatHashBraces: # new in 1.41
431+
Enabled: true
432+
Style/RedundantEach: # new in 1.38
433+
Enabled: true
434+
Style/RedundantFilterChain: # new in 1.52
435+
Enabled: true
436+
Style/RedundantHeredocDelimiterQuotes: # new in 1.45
437+
Enabled: true
438+
Style/RedundantInitialize: # new in 1.27
439+
Enabled: true
440+
Style/RedundantLineContinuation: # new in 1.49
441+
Enabled: true
442+
Style/RedundantRegexpArgument: # new in 1.53
443+
Enabled: true
444+
Style/RedundantRegexpConstructor: # new in 1.52
445+
Enabled: true
446+
Style/RedundantStringEscape: # new in 1.37
447+
Enabled: true
448+
Style/ReturnNilInPredicateMethodDefinition: # new in 1.53
449+
Enabled: true
450+
Style/SingleLineDoEndBlock: # new in 1.57
451+
Enabled: true
452+
Style/SuperWithArgsParentheses: # new in 1.58
453+
Enabled: true
454+
Style/YAMLFileRead: # new in 1.53
455+
Enabled: true
456+
Rails/ActionControllerFlashBeforeRender: # new in 2.16
457+
Enabled: true
458+
Rails/ActionControllerTestCase: # new in 2.14
459+
Enabled: true
460+
Rails/ActionOrder: # new in 2.17
461+
Enabled: true
462+
Rails/ActiveSupportOnLoad: # new in 2.16
463+
Enabled: true
464+
Rails/DangerousColumnNames: # new in 2.21
465+
Enabled: true
466+
Rails/DeprecatedActiveModelErrorsMethods: # new in 2.14
467+
Enabled: true
468+
Rails/DotSeparatedKeys: # new in 2.15
469+
Enabled: true
470+
Rails/DuplicateAssociation: # new in 2.14
471+
Enabled: true
472+
Rails/DuplicateScope: # new in 2.14
473+
Enabled: true
474+
Rails/EnvLocal: # new in 2.22
475+
Enabled: true
476+
Rails/FreezeTime: # new in 2.16
477+
Enabled: true
478+
Rails/I18nLazyLookup: # new in 2.14
479+
Enabled: true
480+
Rails/I18nLocaleTexts: # new in 2.14
353481
Enabled: false

Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ gem 'geoblacklight', '~> 4.1.1'
1313
gem 'importmap-rails'
1414
gem 'jbuilder'
1515
gem 'jquery-rails'
16-
gem 'omniauth', '< 2.0'
17-
gem 'omniauth-cas'
16+
gem 'omniauth'
17+
gem 'omniauth-cas', '3.0.0'
18+
gem 'omniauth-rails_csrf_protection', '~> 1.0'
1819
gem 'pg', '~> 1.4.6'
1920
gem 'puma', '~> 6.4.1'
2021
gem 'rack-timeout', '~> 0.6.3'
@@ -46,6 +47,7 @@ end
4647

4748
group :test do
4849
gem 'capybara'
50+
gem 'rspec', '~> 3.13'
4951
gem 'rspec_junit_formatter', require: false
5052
gem 'selenium-webdriver'
5153
gem 'simplecov', '~> 0.21', require: false

Gemfile.lock

Lines changed: 50 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ GEM
118118
connection_pool (2.4.1)
119119
crass (1.0.6)
120120
date (3.3.4)
121-
debug (1.9.1)
121+
debug (1.9.2)
122122
irb (~> 1.10)
123123
reline (>= 0.3.8)
124124
deep_merge (1.2.2)
125125
deprecation (1.1.0)
126126
activesupport
127-
devise (4.9.3)
127+
devise (4.9.4)
128128
bcrypt (~> 3.0)
129129
orm_adapter (~> 0.1)
130130
railties (>= 4.1.0)
@@ -144,7 +144,7 @@ GEM
144144
faraday-net_http_persistent (2.1.0)
145145
faraday (~> 2.5)
146146
net-http-persistent (~> 4.0)
147-
faraday-retry (2.2.0)
147+
faraday-retry (2.2.1)
148148
faraday (~> 2.0)
149149
ffi (1.16.3)
150150
ffi-compiler (1.3.2)
@@ -208,8 +208,8 @@ GEM
208208
rails-dom-testing (>= 1, < 3)
209209
railties (>= 4.2.0)
210210
thor (>= 0.14, < 2.0)
211-
json (2.7.1)
212-
json-schema (4.2.0)
211+
json (2.7.2)
212+
json-schema (4.3.0)
213213
addressable (>= 2.8)
214214
kaminari (1.2.2)
215215
activesupport (>= 4.1.0)
@@ -242,7 +242,7 @@ GEM
242242
net-smtp
243243
marcel (1.0.4)
244244
matrix (0.4.2)
245-
method_source (1.0.0)
245+
method_source (1.1.0)
246246
mime-types (3.5.2)
247247
mime-types-data (~> 3.2015)
248248
mime-types-data (3.2024.0305)
@@ -261,26 +261,28 @@ GEM
261261
net-protocol
262262
net-protocol (0.2.2)
263263
timeout
264-
net-smtp (0.4.0.1)
264+
net-smtp (0.5.0)
265265
net-protocol
266-
nio4r (2.7.0)
267-
nokogiri (1.16.3-aarch64-linux)
266+
nio4r (2.7.1)
267+
nokogiri (1.16.4-aarch64-linux)
268268
racc (~> 1.4)
269-
nokogiri (1.16.3-arm64-darwin)
269+
nokogiri (1.16.4-x86_64-darwin)
270270
racc (~> 1.4)
271-
nokogiri (1.16.3-x86_64-darwin)
272-
racc (~> 1.4)
273-
nokogiri (1.16.3-x86_64-linux)
271+
nokogiri (1.16.4-x86_64-linux)
274272
racc (~> 1.4)
275273
oj (3.16.3)
276274
bigdecimal (>= 3.0)
277-
omniauth (1.9.2)
275+
omniauth (2.1.2)
278276
hashie (>= 3.4.6)
279-
rack (>= 1.6.2, < 3)
280-
omniauth-cas (2.0.0)
281-
addressable (~> 2.3)
282-
nokogiri (~> 1.5)
283-
omniauth (~> 1.2)
277+
rack (>= 2.2.3)
278+
rack-protection
279+
omniauth-cas (3.0.0)
280+
addressable (~> 2.8)
281+
nokogiri (~> 1.12)
282+
omniauth (~> 2.1)
283+
omniauth-rails_csrf_protection (1.0.1)
284+
actionpack (>= 4.2)
285+
omniauth (~> 2.0)
284286
orm_adapter (0.5.0)
285287
ostruct (0.6.0)
286288
ougai (1.9.1)
@@ -293,11 +295,14 @@ GEM
293295
popper_js (1.16.1)
294296
psych (5.1.2)
295297
stringio
296-
public_suffix (5.0.4)
298+
public_suffix (5.0.5)
297299
puma (6.4.2)
298300
nio4r (~> 2.0)
299301
racc (1.7.3)
300302
rack (2.2.9)
303+
rack-protection (3.2.0)
304+
base64 (>= 0.1.0)
305+
rack (~> 2.2, >= 2.2.4)
301306
rack-test (2.1.0)
302307
rack (>= 1.3)
303308
rack-timeout (0.6.3)
@@ -330,12 +335,12 @@ GEM
330335
thor (~> 1.0)
331336
zeitwerk (~> 2.5)
332337
rainbow (3.1.1)
333-
rake (13.1.0)
338+
rake (13.2.1)
334339
rchardet (1.8.0)
335-
rdoc (6.6.2)
340+
rdoc (6.6.3.1)
336341
psych (>= 4.0.0)
337342
regexp_parser (2.9.0)
338-
reline (0.4.3)
343+
reline (0.5.1)
339344
io-console (~> 0.5)
340345
request_store (1.6.0)
341346
rack (>= 1.4)
@@ -347,9 +352,13 @@ GEM
347352
rgeo (3.0.1)
348353
rgeo-geojson (2.1.1)
349354
rgeo (>= 1.0.0)
350-
rsolr (2.5.0)
355+
rsolr (2.6.0)
351356
builder (>= 2.1.2)
352357
faraday (>= 0.9, < 3, != 2.0.0)
358+
rspec (3.13.0)
359+
rspec-core (~> 3.13.0)
360+
rspec-expectations (~> 3.13.0)
361+
rspec-mocks (~> 3.13.0)
353362
rspec-core (3.13.0)
354363
rspec-support (~> 3.13.0)
355364
rspec-expectations (3.13.0)
@@ -358,18 +367,18 @@ GEM
358367
rspec-mocks (3.13.0)
359368
diff-lcs (>= 1.2.0, < 2.0)
360369
rspec-support (~> 3.13.0)
361-
rspec-rails (6.1.1)
370+
rspec-rails (6.1.2)
362371
actionpack (>= 6.1)
363372
activesupport (>= 6.1)
364373
railties (>= 6.1)
365-
rspec-core (~> 3.12)
366-
rspec-expectations (~> 3.12)
367-
rspec-mocks (~> 3.12)
368-
rspec-support (~> 3.12)
374+
rspec-core (~> 3.13)
375+
rspec-expectations (~> 3.13)
376+
rspec-mocks (~> 3.13)
377+
rspec-support (~> 3.13)
369378
rspec-support (3.13.1)
370379
rspec_junit_formatter (0.6.0)
371380
rspec-core (>= 2, < 4, != 2.12.0)
372-
rubocop (1.62.1)
381+
rubocop (1.63.1)
373382
json (~> 2.3)
374383
language_server-protocol (>= 3.17.0)
375384
parallel (~> 1.10)
@@ -386,15 +395,18 @@ GEM
386395
rubocop (~> 1.41)
387396
rubocop-factory_bot (2.25.1)
388397
rubocop (~> 1.41)
389-
rubocop-rails (2.24.0)
398+
rubocop-rails (2.24.1)
390399
activesupport (>= 4.2.0)
391400
rack (>= 1.1)
392401
rubocop (>= 1.33.0, < 2.0)
393402
rubocop-ast (>= 1.31.1, < 2.0)
394-
rubocop-rspec (2.27.1)
403+
rubocop-rspec (2.29.1)
395404
rubocop (~> 1.40)
396405
rubocop-capybara (~> 2.17)
397406
rubocop-factory_bot (~> 2.22)
407+
rubocop-rspec_rails (~> 2.28)
408+
rubocop-rspec_rails (2.28.3)
409+
rubocop (~> 1.40)
398410
ruby-progressbar (1.13.0)
399411
rubyzip (2.3.2)
400412
sanitize (6.1.0)
@@ -425,7 +437,8 @@ GEM
425437
minitar
426438
retriable
427439
ruby-progressbar
428-
sprockets (3.7.2)
440+
sprockets (3.7.3)
441+
base64
429442
concurrent-ruby (~> 1.0)
430443
rack (> 1, < 3)
431444
sprockets-rails (3.4.2)
@@ -494,13 +507,15 @@ DEPENDENCIES
494507
importmap-rails
495508
jbuilder
496509
jquery-rails
497-
omniauth (< 2.0)
498-
omniauth-cas
510+
omniauth
511+
omniauth-cas (= 3.0.0)
512+
omniauth-rails_csrf_protection (~> 1.0)
499513
pg (~> 1.4.6)
500514
puma (~> 6.4.1)
501515
rack-timeout (~> 0.6.3)
502516
rails (~> 7.0.8)
503517
rsolr (>= 1.0, < 3)
518+
rspec (~> 3.13)
504519
rspec-rails
505520
rspec_junit_formatter
506521
rubocop

app/controllers/application_controller.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ def allow_geoblacklight_params
1010
blacklight_config.search_state_fields.append(Settings.GBL_PARAMS)
1111
end
1212

13+
# root will be used as new_session_path
1314
# Shim because we're not using Devise's :database_authenticatable
14-
def new_session_path(_scope)
15-
new_user_session_path
16-
end
1715

1816
# @param [String] return_url address that calnet will redirect to post-logout
1917
# @return [String] uri to the calnet sso page

0 commit comments

Comments
 (0)