Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salesforce/CCI/Snowfakery integration testing #465

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/extra-checks-after-pull-request-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:

workflow_dispatch:

env:
CUMULUSCI_KEY: ${{ secrets.CUMULUSCI_KEY }}

jobs:
faker_docs:
name: Faker Docs I18N
Expand All @@ -24,3 +27,49 @@ jobs:

- name: Make Docs
run: make docs

salesforce:
name: Test with Salesforce
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "3.9"

- name: "Install dependencies"
run: |
python -VV
python -m pip install --upgrade pip pip-tools
make dev-install
python -m pip install cumulusci

- name: Install sfdx
run: |
mkdir sfdx
wget -qO- https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.xz | tar xJ -C sfdx --strip-components 1
echo $(realpath sfdx/bin) >> $GITHUB_PATH
- name: Authenticate Dev Hub
run: |
sfdx plugins --core
echo $SFDX_HUB_KEY_BASE64 | base64 --decode > sfdx.key
sfdx auth:jwt:grant --clientid $SFDX_CLIENT_ID --jwtkeyfile sfdx.key --username $SFDX_HUB_USERNAME --setdefaultdevhubusername -a hub
env:
SFDX_HUB_KEY_BASE64: ${{ secrets.SFDX_HUB_KEY_BASE64 }}
SFDX_CLIENT_ID: ${{ secrets.SFDX_CLIENT_ID }}
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
- name: Run Snowfakery Tests
run: |
cci flow run test_everything --org dev
- name: Delete scratch org
if: always()
run: |
cci org scratch_delete dev salesforce:

- name: Run Snowfakery VCR Tests
run: |
pytest --org dev
- name: Delete scratch org
if: always()
run: |
cci org scratch_delete dev
55 changes: 42 additions & 13 deletions cumulusci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ project:
name: Snowfakery
package:
api_version: "50.0"
dependencies:
- github: https://github.com/SalesforceFoundation/NPSP

sources:
npsp:
github: https://github.com/SalesforceFoundation/NPSP
# NPSP tests are disabled for now. Need time to debug.
# dependencies:
# - namespace: npe01
# version: 3.17
# - namespace: npo02
# version: 3.14
# - namespace: npe03
# version: 3.21
# - namespace: npe4
# version: 3.11
# - namespace: npe5
# version: 3.9
# - namespace: npsp
# version: 3.199

tasks:
generate_sf_accounts:
Expand Down Expand Up @@ -77,13 +86,14 @@ flows:
3:
task: generate_sf_opportunities
4:
flow: npsp:install_prod
5:
task: generate_npsp_accounts
6:
task: generate_npsp_contacts
7:
task: generate_npsp_opportunities
task: update_dependencies
# NPSP tests are disabled for now. Need time to debug.
# 5:
# task: generate_npsp_accounts
# 6:
# task: generate_npsp_contacts
# 7:
# task: generate_npsp_opportunities
8:
task: generate_opportunity_contact_roles
9:
Expand All @@ -106,6 +116,23 @@ flows:
num_records: 100
num_records_tablename: Contact

campaign_members_for_campaigns:
steps:
1:
task: generate_and_load_from_yaml
options:
generator_yaml: examples/salesforce/Campaign.recipe.yml

2:
task: generate_and_load_from_yaml
options:
generator_yaml: examples/salesforce/CampaignMembers-random.recipe.yml

3:
task: generate_and_load_from_yaml
options:
generator_yaml: examples/salesforce/CampaignMembers-first.recipe.yml

person_accounts_and_community_users:
# only for use with the persons_and_communities org shape
steps:
Expand All @@ -123,6 +150,8 @@ flows:
insert ur;
update new User(Id = UserInfo.getUserId(), UserRoleId = ur.Id);
3:
task: update_admin_profile
4:
task: generate_and_load_from_yaml
options:
generator_yaml: examples/salesforce/person-accounts-plugin.recipe.yml
Expand All @@ -131,5 +160,5 @@ flows:

orgs:
scratch:
person_and_communities:
persons_and_communities:
config_file: orgs/persons_and_communities.json
8 changes: 8 additions & 0 deletions orgs/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
}
},
"objectSettings": {
"account": {
"defaultRecordType": "default"
},
"opportunity": {
"defaultRecordType": "default"
}
}
}