Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
brienne
Developer Documentation
Commits
4a70bfa3
Commit
4a70bfa3
authored
7 years ago
by
Sean Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Import "Smart+group+testing" wiki page
https://wiki.civicrm.org/confluence/display/CRMDOC/Smart+group+testing
parent
a3153ca8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/testing/manual.md
+63
-0
63 additions, 0 deletions
docs/testing/manual.md
redirects/wiki-crmdoc.txt
+1
-0
1 addition, 0 deletions
redirects/wiki-crmdoc.txt
with
64 additions
and
0 deletions
docs/testing/manual.md
+
63
−
0
View file @
4a70bfa3
...
...
@@ -75,3 +75,66 @@ From the dedupe listing screen.
@todo
# Smart group testing
### General use cases
-
Run advanced search by name=Adams. Create a smart group. Check
group membership.
-
Run advanced search by name=Bachman. Create a smart group. Check
group membership.
-
Edit a contact, changing last name to Adams. Check group membership.
Observe new member.
-
Edit a contact, changing last name away from Adams. Check
group memberhsip. Observe removed member.
-
Add a contact with last name Bachman. Check group membership.
Observe new member.
-
Delete a contact with last name Bachman. Check group membership.
Observe missing member.
-
Update definition of group Bachman to filter on
contact_type=Individual. Check group membership. Observe removed
member (household "Bachman family").
### Confounding Factors
Smart groups are cached. The caching behavior is influenced by a couple
options:
-
**"smartGroupCacheTimeout**
": Time-to-live (e.g. "retain the cached
list of members for 5 minutes")
-
**"smart_group_cache_refresh_mode**
": Refresh-mode
\
-
"opportunistic": (e.g. "flush stale caches whenever
data changes")
-
"deterministic": (e.g. "flush stale caches using a cron job")
You may experience slightly different behaviors depending what was
cached before, how you time the steps, and which options are chosen.
Think of it this way; each general use-case includes the step "Check
group membership". As part of that step, you might initially see a stale
list of members. To force it to display an actual list, you might wait 5
minutes (to pass the TTL)
**OR**
hack
*civicrm_group.cache_date*
to
set an earlier expiration.
If your main interest is browsing the list of members through the UI,
then (in my experience) it's not necessary to explicitly run the cron
job. When you look at a group in the UI, it checks the staleness and
updates the cache (if it's expired).
However, if your main interest is testing the nuances of refresh-modes,
then you should
*not*
check the list of members through the UI. Instead:
-
Repeatedly use SQL to inspect the content of "civicrm_group" and
"civicrm_group_contact_cache"
-
For opportunistic mode, trigger a flush by editing some
unrelated contact.
-
For deterministic cron mode, trigger a flush by calling
"Job.group_cache_flush" API.
WISHLIST: For testing/inspection purposes, it would help to update the
list screen ("Contacts in Group" aka "civicrm/group/search"):
-
Display the timestamp for when the cache was generated
-
Provide a button to force the cache to regenerate
This diff is collapsed.
Click to expand it.
redirects/wiki-crmdoc.txt
+
1
−
0
View file @
4a70bfa3
...
...
@@ -170,3 +170,4 @@ Using+Custom+Data+with+the+API api/custom-data
CiviReport+Reference reference/civireport
Manual+testing testing/manual
Dedupe+and+merge+testing testing/manual
Smart+group+testing testing/manual
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment