Order-dependent issue in ee/spec/lib/omni_auth/strategies/group_saml_spec.rb
Running the following allows to reproduce (what I think is) an order-dependent issue in ee/spec/lib/omni_auth/strategies/group_saml_spec.rb:
bundle exec rspec -- ee/spec/features/groups/saml_providers_spec.rb:80 ee/spec/lib/omni_auth/strategies/group_saml_spec.rb:99
results in
1) OmniAuth::Strategies::GroupSaml POST /groups/:group_path/-/saml/callback with invalid SAMLResponse redirects somewhere so failure messages can be displayed
Failure/Error:
super.tap do
@response = ActionDispatch::TestResponse.from_response(last_response)
end
OneLogin::RubySaml::ValidationError:
Current time is on or after NotOnOrAfter condition (2021-04-26 08:18:12 UTC >= 2012-11-08 20:44:54 UTC)
# ./ee/lib/omni_auth/strategies/group_saml.rb:47:in `callback_phase'
# ./spec/support/omniauth_strategy.rb:10:in `post'
# ./ee/spec/lib/omni_auth/strategies/group_saml_spec.rb:100:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:355:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:346:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:342:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:31:in `with_raw_context'
# ./spec/spec_helper.rb:342:in `block (2 levels) in <top (required)>'
# ./spec/support/omniauth_strategy.rb:38:in `block (3 levels) in <main>'
# ./spec/support/omniauth_strategy.rb:26:in `without_test_mode'
# ./spec/support/omniauth_strategy.rb:37:in `block (2 levels) in <main>'
I believe removing the :js
metadata from the first test file makes the second test file pass so it's probably related. In our CI, we never run unit and system tests in the same jobs, except for the rspec fail-fast
job which runs tests based on the files changed in the MR, regardless of their type. This might be the problem here (even though running a unit and a system test shouldn't fail in general).
Maybe someone from the ~"group::access" group can investigate this?