Conversation
|
The call to |
|
Further cornered to Ruby 2.3 doesn't like that we iterate an Array from which we're currently deleting. Using a distinct Array fixed the bug. |
|
Down to 1 failing spec, which tells me I fixed the issue of not computing policies but failed the compaction (de-duplicating policies). |
|
Urgh, actually I only updated the development environment to Ruby 2.3, the production is still running Ruby 2.2, but hopefully we already have the |
0529881 to
efac87c
Compare
The upgrade went almost smoothly, if not for a regression in the Policy System. Once we identify and fix that bug, then we can upgrade to Ruby 2.3 with high confidence.
Fix 1 spec that hangs forever (disabled for now):
spec/models/policy_spec.rb:271# Policy Institution Read allows checking when there's a loopFix 15 failing policy specs (probably the same issue):
rspec ./spec/models/test_result_query_spec.rb:43# TestResultQuery policies delegates all tests from a userrspec ./spec/models/test_result_query_spec.rb:123# TestResultQuery policies have access with policy by site with childrenrspec ./spec/models/test_result_query_spec.rb:99# TestResultQuery policies have access with policy by institutionrspec ./spec/models/policy_spec.rb:89# Policy Authorize should return an instance when queried over an instancerspec ./spec/models/policy_spec.rb:77# Policy Authorize should return a scope when queried over a classrspec ./spec/models/policy_spec.rb:790# Policy Test Result Query allows to query test result by siterspec ./spec/models/policy_spec.rb:815# Policy Test Result Query returns a scope with tests authorised by devicerspec ./spec/models/policy_spec.rb:785# Policy Test Result Query allows to query test result by institutionrspec ./spec/models/policy_spec.rb:795# Policy Test Result Query allows to query test result by devicerspec ./spec/models/policy_spec.rb:800# Policy Test Result Query returns a scope with tests authorised by institutionrspec ./spec/models/policy_spec.rb:805# Policy Test Result Query returns a scope with tests authorised by siterspec ./spec/models/policy_spec.rb:826# Policy Test Result Query returns a scope with all testsrspec ./spec/models/policy_spec.rb:820# Policy Test Result Query returns a scope with tests authorised by multiple criteriarspec ./spec/models/computed_policy_spec.rb:165# ComputedPolicy from regular user should compact identical rules in policiesrspec ./spec/controllers/api/sites_controller_spec.rb:72# Api::SitesController Sites hierarchical READ_SITE should propagate to the childsFix new failing spec:
rspec ./spec/models/computed_policy_spec.rb:340# ComputedPolicy recursively should support a loop of policies