Skip to content

Commit

Permalink
Merge pull request #1428 from SFDO-Community/feature/qa-high-ratio-data
Browse files Browse the repository at this point in the history
High Ratio Custom Object for Rollup Testing
  • Loading branch information
aheber authored Sep 27, 2024
2 parents a8fd4a3 + fa3c92a commit e5d83de
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 0 deletions.
43 changes: 43 additions & 0 deletions datasets/qa/high-ratio-tests-custom-object.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Section uses the QA Lookup Parent object to create high ratio data.
# There is one parent, with 25,000 sub-parents each with 1 child.
# There is a second top level parent with all 25,000 children attached.
#QA Lookup Parent Record to be referenced later for Second Lookup on Child
- object: QALookupParent__c
nickname: TopLevelParent
count: 1
fields:
Name: Top Level Parent High Ratio
#QA Lookup Parent Record that will have child QA Lookup Parent
- object: QALookupParent__c
nickname: TopHierarchyParent
count: 1
fields:
Name: Top Level of a wide hierarchy
friends:
- object: QALookupParent__c
nickname: CustomParentwithChild
count: 25000
fields:
Name: QALookupParentwithChild
Self_Relationship__c:
reference: TopHierarchyParent
friends:
- object: QALookupChild__c
nickname: CustomChild
count: 1
fields:
Name: ${{fake.Text(max_nb_chars = 25)}}
Amount__c: 1000
Color__c:
random_choice:
- Red
- Yellow
- Green
- Blue
Description__c: ${{fake.Text(max_nb_chars = 200)}}
Description2__c: ${{fake.Text(max_nb_chars = 200)}}
LookupParent__c:
reference: CustomParentwithChild

LookupParent2__c:
reference: TopLevelParent
110 changes: 110 additions & 0 deletions datasets/qa/high-ratio-tests-stand-objects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Macros to reduce duplicate field definitions. All non-reference fields for
# each object type should be listed here. We don't bother with Account since
# we just set the Name field.

# Fields to use on all Contacts
- macro: contact_base
fields:
Firstname:
fake: first_name
Lastname:
fake: last_name

# Fields to use on Cases
- macro: case_base
fields:
Subject: ${{fake.Text(max_nb_chars = 20)}}
Description: ${{fake.Paragraph(nb_sentences=5)}}

# Fields to use on Opportunities
- macro: opp_base
fields:
Name: ${{fake.Word}} Opportunity
Stagename:
random_choice:
Prospecting: 5%
Qualification: 5%
Closed Won: 80%
Closed Lost: 10%
CloseDate:
date_between:
start_date: -1y
end_date: today
Amount:
random_number:
min: 1000
max: 10000
step: 50

- object: Account
count: 1
nickname: TopLevelAccount
fields:
Name:
fake: Company
friends:
- object: Account
nickname: ChildAccount
fields:
Name:
fake: Company
friends:
- object: Contact # Contacts for the child account
count: 50
include: contact_base
fields:
AccountId:
reference: ChildAccount
- object: Case # Case for child Account
count: 500
include: case_base
fields:
AccountId:
reference: ChildAccount
ContactId:
random_reference:
to: Contact
unique: False
- object: Contact # Contacts for the top level account.
count: 50
include: contact_base
fields:
AccountId:
reference: TopLevelAccount
- object: Case # Case for Parent Account
count: 500
include: case_base
fields:
AccountId:
reference: TopLevelAccount
ContactId:
random_reference:
to: Contact
unique: False
- object: Opportunity
count: 500
include: opp_base
fields:
AccountId:
reference: TopLevelAccount
ContactId:
random_reference:
to: Contact
unique: False
friends:
- object: OpportunityContactRole
count: 2
fields:
OpportunityId:
reference: Opportunity
ContactId:
random_reference:
to: Contact
unique: False
Role:
random_choice:
Business User: 20%
Decision Maker: 20%
Economic Buyer: 20%
Economic Decision Maker: 20%
Evaluator: 20%

0 comments on commit e5d83de

Please sign in to comment.