canvas-lms/spec
Pablo Marti-Gomez 4c65f3f583 Add cache to Outcomes::LearningOutcomeGroupChildren
Updates Outcomes::LearningOutcomeGroupChildren by adding cache
at the queries for getting the total subgroups and outcomes.

closes OUT-4148
flag=improved_outcomes_management

Test plan:
- Create nested learning outcome groups
- For each nested learning outcome group create learning outcomes
> With FF improved_outcomes_management: OFF
- On Rails console: calls to Outcomes::LearningOutcomeGroupChildren
methods should return a default value
- On web: when generating actions over ContentTag, LearningOutcome
and LearningOutcomeGroup it should not lead to clear any cache
> With FF improved_outcomes_management: ON
- On Rails console: call Outcomes::LearningOutcomeGroupChildren
methods for getting total subgroups and outcomes, queries to the
DB should be made (it will need the root context)
- Call again the same methods, it should return the values from
cache
- Create a new instance of the class and call the same methods,
it should return the values from cache
- Clear the cache with `Rails.cache.clear`
- On web (or through GraphiQL) get the total subgroups and total
outcomes multiple times; it should cache the data and should not
run additional queries
- On web: clear the cache by executing the following actions:
  - Add a Learning Outcome Group
  - Adopt a Learning Outcome Group
  - Copy a Learning Outcome Group from global
  - Remove a Learning Outcome Group
  - Add an Outcome
  - Remove an Outcome
- Get the total subgroups and total outcomes, it should run new
queries
- Run the same tests for global context, it should generate and
clear the cache in the same way

Change-Id: I9b0bfc68b84b3e36869d69a926ef84d9989ea96d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/257257
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Chrystal Langston <chrystal.langston@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2021-03-17 16:49:37 +00:00
..
apis Revert "create user observer link when enrolling observer" 2021-03-16 18:25:21 +00:00
coffeescripts spec: fix incorrect specs in EditViewSpec 2021-03-15 17:30:43 +00:00
contracts Remove public contract tests 2021-03-10 19:41:39 +00:00
controllers MSFT sync group create endpoint 2021-03-16 20:36:57 +00:00
factories Set up replica identity index for UserAccountAssociation 2021-03-16 20:01:43 +00:00
factory_bot add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
fixtures spec: hackweek data generation project 2021-03-11 15:27:53 +00:00
formatters only output error pages if not discarded 2021-03-10 16:54:49 +00:00
gem_integration/canvas_connect add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
graphql Add cache to Outcomes::LearningOutcomeGroupChildren 2021-03-17 16:49:37 +00:00
helpers set new math ENV.FEATURES flag based on root account, not site_admin 2021-02-26 20:51:48 +00:00
initializers Show a maintenance window 2021-03-11 19:04:36 +00:00
instfs/selenium add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
integration Remove ability to look user up by id - hash is now needed 2021-03-16 20:16:16 +00:00
javascripts LTI icon shows as a 'bomb' instead of the tool's icon 2021-03-12 17:58:07 +00:00
lib Add cache to Outcomes::LearningOutcomeGroupChildren 2021-03-17 16:49:37 +00:00
manual_seeding add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
messages Remove link to reschedule if appointment group is not active 2021-03-08 22:08:41 +00:00
migrations add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
models clean up stream items more efficiently 2021-03-17 16:38:48 +00:00
observers revert overridden_requirements_met in course completion live events 2021-03-10 23:20:49 +00:00
presenters Round grade summary score stats to 2 places 2021-03-17 14:57:20 +00:00
requests add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
schemas/lti add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
selenium Round grade summary score stats to 2 places 2021-03-17 14:57:20 +00:00
serializers part 3: change lookup_id and resource_link_id to UUID datatype 2021-02-11 18:02:20 +00:00
shared_examples Allow reassignment from SpeedGrader 2021-02-17 00:28:25 +00:00
support raise exception if custom_timeout greater than 60s 2021-02-03 22:15:25 +00:00
views Impliment SiteAdmin notifications 2021-03-16 16:12:33 +00:00
.eslintrc
.rspec_parallel use parallel_tests for more parallelization 2020-03-30 21:38:47 +00:00
ams_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
axe_selenium_helper.rb spec: reset selenium-axe before each suite instead of before all 2021-03-16 19:26:59 +00:00
broadcast_integration.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
cassandra_spec_helper.rb move database_builder to canvas_cassandra 2021-02-25 15:19:20 +00:00
conditional_release_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
coverage_tool.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
factories.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
factory_bot_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
feature_flag_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
file_upload_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
force_failure_spec.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
import_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
jspec.sh
lti2_course_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
lti2_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
lti_1_3_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
lti_1_3_tool_configuration_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
lti_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
plagiarism_platform_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
quiz_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
rcov.opts
rspec_mock_extensions.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
sharding_spec_helper.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
simple_cov_result_merger.rb add # frozen_string_literal: true for specs 2020-10-27 20:48:35 +00:00
spec.opts remove abort_on_consistent_badness_formatter 2020-10-13 18:10:04 +00:00
spec_helper.rb allow ENABLE_AXE_SELENIUM to be used as env var 2021-03-15 15:11:09 +00:00