cumulusci-plus 5.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cumulusci-plus might be problematic. Click here for more details.
- cumulusci/__about__.py +1 -0
- cumulusci/__init__.py +22 -0
- cumulusci/__main__.py +3 -0
- cumulusci/cli/__init__.py +0 -0
- cumulusci/cli/cci.py +244 -0
- cumulusci/cli/error.py +125 -0
- cumulusci/cli/flow.py +185 -0
- cumulusci/cli/logger.py +72 -0
- cumulusci/cli/org.py +692 -0
- cumulusci/cli/plan.py +181 -0
- cumulusci/cli/project.py +391 -0
- cumulusci/cli/robot.py +116 -0
- cumulusci/cli/runtime.py +190 -0
- cumulusci/cli/service.py +521 -0
- cumulusci/cli/task.py +295 -0
- cumulusci/cli/tests/__init__.py +0 -0
- cumulusci/cli/tests/test_cci.py +545 -0
- cumulusci/cli/tests/test_error.py +170 -0
- cumulusci/cli/tests/test_flow.py +276 -0
- cumulusci/cli/tests/test_logger.py +25 -0
- cumulusci/cli/tests/test_org.py +1438 -0
- cumulusci/cli/tests/test_plan.py +245 -0
- cumulusci/cli/tests/test_project.py +235 -0
- cumulusci/cli/tests/test_robot.py +177 -0
- cumulusci/cli/tests/test_runtime.py +197 -0
- cumulusci/cli/tests/test_service.py +853 -0
- cumulusci/cli/tests/test_task.py +266 -0
- cumulusci/cli/tests/test_ui.py +310 -0
- cumulusci/cli/tests/test_utils.py +122 -0
- cumulusci/cli/tests/utils.py +52 -0
- cumulusci/cli/ui.py +234 -0
- cumulusci/cli/utils.py +150 -0
- cumulusci/conftest.py +181 -0
- cumulusci/core/__init__.py +0 -0
- cumulusci/core/config/BaseConfig.py +5 -0
- cumulusci/core/config/BaseTaskFlowConfig.py +5 -0
- cumulusci/core/config/OrgConfig.py +5 -0
- cumulusci/core/config/ScratchOrgConfig.py +5 -0
- cumulusci/core/config/__init__.py +125 -0
- cumulusci/core/config/base_config.py +111 -0
- cumulusci/core/config/base_task_flow_config.py +82 -0
- cumulusci/core/config/marketing_cloud_service_config.py +83 -0
- cumulusci/core/config/oauth2_service_config.py +17 -0
- cumulusci/core/config/org_config.py +604 -0
- cumulusci/core/config/project_config.py +782 -0
- cumulusci/core/config/scratch_org_config.py +251 -0
- cumulusci/core/config/sfdx_org_config.py +220 -0
- cumulusci/core/config/tests/_test_config_backwards_compatibility.py +33 -0
- cumulusci/core/config/tests/test_config.py +1895 -0
- cumulusci/core/config/tests/test_config_expensive.py +839 -0
- cumulusci/core/config/tests/test_config_util.py +91 -0
- cumulusci/core/config/universal_config.py +88 -0
- cumulusci/core/config/util.py +18 -0
- cumulusci/core/datasets.py +303 -0
- cumulusci/core/debug.py +33 -0
- cumulusci/core/dependencies/__init__.py +55 -0
- cumulusci/core/dependencies/base.py +561 -0
- cumulusci/core/dependencies/dependencies.py +273 -0
- cumulusci/core/dependencies/github.py +177 -0
- cumulusci/core/dependencies/github_resolvers.py +244 -0
- cumulusci/core/dependencies/resolvers.py +580 -0
- cumulusci/core/dependencies/tests/__init__.py +0 -0
- cumulusci/core/dependencies/tests/conftest.py +385 -0
- cumulusci/core/dependencies/tests/test_dependencies.py +950 -0
- cumulusci/core/dependencies/tests/test_github.py +83 -0
- cumulusci/core/dependencies/tests/test_resolvers.py +1027 -0
- cumulusci/core/dependencies/utils.py +13 -0
- cumulusci/core/enums.py +11 -0
- cumulusci/core/exceptions.py +311 -0
- cumulusci/core/flowrunner.py +888 -0
- cumulusci/core/github.py +665 -0
- cumulusci/core/keychain/__init__.py +24 -0
- cumulusci/core/keychain/base_project_keychain.py +441 -0
- cumulusci/core/keychain/encrypted_file_project_keychain.py +945 -0
- cumulusci/core/keychain/environment_project_keychain.py +7 -0
- cumulusci/core/keychain/serialization.py +152 -0
- cumulusci/core/keychain/subprocess_keychain.py +24 -0
- cumulusci/core/keychain/tests/conftest.py +50 -0
- cumulusci/core/keychain/tests/test_base_project_keychain.py +299 -0
- cumulusci/core/keychain/tests/test_encrypted_file_project_keychain.py +1228 -0
- cumulusci/core/metadeploy/__init__.py +0 -0
- cumulusci/core/metadeploy/api.py +88 -0
- cumulusci/core/metadeploy/plans.py +25 -0
- cumulusci/core/metadeploy/tests/test_api.py +276 -0
- cumulusci/core/runtime.py +115 -0
- cumulusci/core/sfdx.py +162 -0
- cumulusci/core/source/__init__.py +16 -0
- cumulusci/core/source/github.py +50 -0
- cumulusci/core/source/local_folder.py +35 -0
- cumulusci/core/source_transforms/__init__.py +0 -0
- cumulusci/core/source_transforms/tests/test_transforms.py +1091 -0
- cumulusci/core/source_transforms/transforms.py +532 -0
- cumulusci/core/tasks.py +404 -0
- cumulusci/core/template_utils.py +59 -0
- cumulusci/core/tests/__init__.py +0 -0
- cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_e2e.yaml +215 -0
- cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_extract_standard_objects.yaml +199 -0
- cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_read_explicit_extract_declaration.yaml +3 -0
- cumulusci/core/tests/fake_remote_repo/cumulusci.yml +32 -0
- cumulusci/core/tests/fake_remote_repo/tasks/directory/example_2.py +6 -0
- cumulusci/core/tests/fake_remote_repo/tasks/example.py +43 -0
- cumulusci/core/tests/fake_remote_repo_2/cumulusci.yml +11 -0
- cumulusci/core/tests/fake_remote_repo_2/tasks/example_3.py +6 -0
- cumulusci/core/tests/test_datasets_e2e.py +386 -0
- cumulusci/core/tests/test_exceptions.py +11 -0
- cumulusci/core/tests/test_flowrunner.py +836 -0
- cumulusci/core/tests/test_github.py +942 -0
- cumulusci/core/tests/test_sfdx.py +138 -0
- cumulusci/core/tests/test_source.py +678 -0
- cumulusci/core/tests/test_tasks.py +262 -0
- cumulusci/core/tests/test_utils.py +141 -0
- cumulusci/core/tests/test_utils_merge_config.py +276 -0
- cumulusci/core/tests/test_versions.py +76 -0
- cumulusci/core/tests/untrusted_repo_child/cumulusci.yml +7 -0
- cumulusci/core/tests/untrusted_repo_child/tasks/untrusted_child.py +6 -0
- cumulusci/core/tests/untrusted_repo_parent/cumulusci.yml +26 -0
- cumulusci/core/tests/untrusted_repo_parent/tasks/untrusted_parent.py +6 -0
- cumulusci/core/tests/utils.py +116 -0
- cumulusci/core/tests/yaml/global.yaml +0 -0
- cumulusci/core/utils.py +402 -0
- cumulusci/core/versions.py +149 -0
- cumulusci/cumulusci.yml +1621 -0
- cumulusci/files/admin_profile.xml +20 -0
- cumulusci/files/delete_excludes.txt +424 -0
- cumulusci/files/templates/project/README.md +12 -0
- cumulusci/files/templates/project/cumulusci.yml +63 -0
- cumulusci/files/templates/project/dot-gitignore +60 -0
- cumulusci/files/templates/project/mapping.yml +45 -0
- cumulusci/files/templates/project/scratch_def.json +25 -0
- cumulusci/oauth/__init__.py +0 -0
- cumulusci/oauth/client.py +400 -0
- cumulusci/oauth/exceptions.py +9 -0
- cumulusci/oauth/salesforce.py +95 -0
- cumulusci/oauth/tests/__init__.py +0 -0
- cumulusci/oauth/tests/cassettes/test_get_device_code.yaml +22 -0
- cumulusci/oauth/tests/cassettes/test_get_device_oauth_token.yaml +74 -0
- cumulusci/oauth/tests/test_client.py +308 -0
- cumulusci/oauth/tests/test_salesforce.py +46 -0
- cumulusci/plugins/__init__.py +3 -0
- cumulusci/plugins/plugin_base.py +93 -0
- cumulusci/plugins/plugin_loader.py +59 -0
- cumulusci/robotframework/CumulusCI.py +340 -0
- cumulusci/robotframework/CumulusCI.robot +7 -0
- cumulusci/robotframework/Performance.py +165 -0
- cumulusci/robotframework/Salesforce.py +936 -0
- cumulusci/robotframework/Salesforce.robot +192 -0
- cumulusci/robotframework/SalesforceAPI.py +416 -0
- cumulusci/robotframework/SalesforcePlaywright.py +220 -0
- cumulusci/robotframework/SalesforcePlaywright.robot +40 -0
- cumulusci/robotframework/__init__.py +2 -0
- cumulusci/robotframework/base_library.py +39 -0
- cumulusci/robotframework/faker_mixin.py +89 -0
- cumulusci/robotframework/form_handlers.py +222 -0
- cumulusci/robotframework/javascript/cci_init.js +34 -0
- cumulusci/robotframework/javascript/cumulusci.js +4 -0
- cumulusci/robotframework/locator_manager.py +197 -0
- cumulusci/robotframework/locators_56.py +88 -0
- cumulusci/robotframework/locators_57.py +5 -0
- cumulusci/robotframework/pageobjects/BasePageObjects.py +433 -0
- cumulusci/robotframework/pageobjects/ObjectManagerPageObject.py +246 -0
- cumulusci/robotframework/pageobjects/PageObjectLibrary.py +45 -0
- cumulusci/robotframework/pageobjects/PageObjects.py +351 -0
- cumulusci/robotframework/pageobjects/__init__.py +12 -0
- cumulusci/robotframework/pageobjects/baseobjects.py +120 -0
- cumulusci/robotframework/perftests/short/collection_perf.robot +105 -0
- cumulusci/robotframework/tests/CustomObjectTestPage.py +10 -0
- cumulusci/robotframework/tests/FooTestPage.py +8 -0
- cumulusci/robotframework/tests/cumulusci/base.robot +40 -0
- cumulusci/robotframework/tests/cumulusci/bulkdata.robot +38 -0
- cumulusci/robotframework/tests/cumulusci/communities.robot +57 -0
- cumulusci/robotframework/tests/cumulusci/datagen.robot +84 -0
- cumulusci/robotframework/tests/salesforce/TestLibraryA.py +24 -0
- cumulusci/robotframework/tests/salesforce/TestLibraryB.py +20 -0
- cumulusci/robotframework/tests/salesforce/TestListener.py +93 -0
- cumulusci/robotframework/tests/salesforce/api.robot +178 -0
- cumulusci/robotframework/tests/salesforce/browsers.robot +143 -0
- cumulusci/robotframework/tests/salesforce/classic.robot +51 -0
- cumulusci/robotframework/tests/salesforce/create_contact.robot +59 -0
- cumulusci/robotframework/tests/salesforce/faker.robot +68 -0
- cumulusci/robotframework/tests/salesforce/forms.robot +172 -0
- cumulusci/robotframework/tests/salesforce/label_locator.robot +244 -0
- cumulusci/robotframework/tests/salesforce/labels.html +33 -0
- cumulusci/robotframework/tests/salesforce/locators.robot +149 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/base_pageobjects.robot +100 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/example_page_object.py +25 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/listing_page.robot +115 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/objectmanager.robot +74 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/pageobjects.robot +171 -0
- cumulusci/robotframework/tests/salesforce/performance.robot +109 -0
- cumulusci/robotframework/tests/salesforce/playwright/javascript_keywords.robot +33 -0
- cumulusci/robotframework/tests/salesforce/playwright/open_test_browser.robot +48 -0
- cumulusci/robotframework/tests/salesforce/playwright/playwright.robot +24 -0
- cumulusci/robotframework/tests/salesforce/playwright/ui.robot +32 -0
- cumulusci/robotframework/tests/salesforce/populate.robot +89 -0
- cumulusci/robotframework/tests/salesforce/test_testlistener.py +37 -0
- cumulusci/robotframework/tests/salesforce/ui.robot +361 -0
- cumulusci/robotframework/tests/test_cumulusci_library.py +304 -0
- cumulusci/robotframework/tests/test_locator_manager.py +158 -0
- cumulusci/robotframework/tests/test_pageobjects.py +291 -0
- cumulusci/robotframework/tests/test_performance.py +38 -0
- cumulusci/robotframework/tests/test_salesforce.py +79 -0
- cumulusci/robotframework/tests/test_salesforce_locators.py +73 -0
- cumulusci/robotframework/tests/test_template_util.py +53 -0
- cumulusci/robotframework/tests/test_utils.py +106 -0
- cumulusci/robotframework/utils.py +283 -0
- cumulusci/salesforce_api/__init__.py +0 -0
- cumulusci/salesforce_api/exceptions.py +23 -0
- cumulusci/salesforce_api/filterable_objects.py +96 -0
- cumulusci/salesforce_api/mc_soap_envelopes.py +89 -0
- cumulusci/salesforce_api/metadata.py +721 -0
- cumulusci/salesforce_api/org_schema.py +571 -0
- cumulusci/salesforce_api/org_schema_models.py +226 -0
- cumulusci/salesforce_api/package_install.py +265 -0
- cumulusci/salesforce_api/package_zip.py +301 -0
- cumulusci/salesforce_api/rest_deploy.py +148 -0
- cumulusci/salesforce_api/retrieve_profile_api.py +301 -0
- cumulusci/salesforce_api/soap_envelopes.py +177 -0
- cumulusci/salesforce_api/tests/__init__.py +0 -0
- cumulusci/salesforce_api/tests/metadata_test_strings.py +24 -0
- cumulusci/salesforce_api/tests/test_metadata.py +1015 -0
- cumulusci/salesforce_api/tests/test_package_install.py +219 -0
- cumulusci/salesforce_api/tests/test_package_zip.py +380 -0
- cumulusci/salesforce_api/tests/test_rest_deploy.py +264 -0
- cumulusci/salesforce_api/tests/test_retrieve_profile_api.py +337 -0
- cumulusci/salesforce_api/tests/test_utils.py +124 -0
- cumulusci/salesforce_api/utils.py +51 -0
- cumulusci/schema/cumulusci.jsonschema.json +782 -0
- cumulusci/tasks/__init__.py +0 -0
- cumulusci/tasks/apex/__init__.py +0 -0
- cumulusci/tasks/apex/anon.py +157 -0
- cumulusci/tasks/apex/batch.py +180 -0
- cumulusci/tasks/apex/testrunner.py +835 -0
- cumulusci/tasks/apex/tests/cassettes/ManualEditTestApexIntegrationTests.test_run_tests__integration_test.yaml +703 -0
- cumulusci/tasks/apex/tests/test_apex_tasks.py +1558 -0
- cumulusci/tasks/base_source_control_task.py +17 -0
- cumulusci/tasks/bulkdata/__init__.py +15 -0
- cumulusci/tasks/bulkdata/base_generate_data_task.py +96 -0
- cumulusci/tasks/bulkdata/dates.py +97 -0
- cumulusci/tasks/bulkdata/delete.py +156 -0
- cumulusci/tasks/bulkdata/extract.py +441 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py +117 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/extract_yml.py +123 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/hardcoded_default_declarations.py +49 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/synthesize_extract_declarations.py +283 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/tests/test_extract_yml.py +142 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/tests/test_synthesize_extract_declarations.py +575 -0
- cumulusci/tasks/bulkdata/factory_utils.py +134 -0
- cumulusci/tasks/bulkdata/generate.py +4 -0
- cumulusci/tasks/bulkdata/generate_and_load_data.py +232 -0
- cumulusci/tasks/bulkdata/generate_and_load_data_from_yaml.py +19 -0
- cumulusci/tasks/bulkdata/generate_from_yaml.py +183 -0
- cumulusci/tasks/bulkdata/generate_mapping.py +434 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/dependency_map.py +169 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/extract_mapping_file_generator.py +45 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py +121 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/load_mapping_file_generator.py +127 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/mapping_generator_post_processes.py +53 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/mapping_transforms.py +139 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_generate_extract_mapping_from_declarations.py +135 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_generate_load_mapping_from_declarations.py +330 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_mapping_generator_post_processes.py +60 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_mapping_transforms.py +188 -0
- cumulusci/tasks/bulkdata/load.py +1196 -0
- cumulusci/tasks/bulkdata/mapping_parser.py +811 -0
- cumulusci/tasks/bulkdata/query_transformers.py +264 -0
- cumulusci/tasks/bulkdata/select_utils.py +792 -0
- cumulusci/tasks/bulkdata/snowfakery.py +753 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/queue_manager.py +478 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/snowfakery_run_until.py +141 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/snowfakery_working_directory.py +53 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/subtask_configurator.py +64 -0
- cumulusci/tasks/bulkdata/step.py +1242 -0
- cumulusci/tasks/bulkdata/tests/__init__.py +0 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_random_strategy.yaml +147 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_annoy_strategy.yaml +123 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_select_and_insert_strategy.yaml +313 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_select_and_insert_strategy_bulk.yaml +550 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_strategy.yaml +175 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_standard_strategy.yaml +147 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_run_until_records_in_org__multiple_needed.yaml +69 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_run_until_records_in_org__none_needed.yaml +22 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_run_until_records_in_org__one_needed.yaml +24 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_snowfakery_query_salesforce.yaml +25 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpdatesIntegrationTests.test_updates_task.yaml +80 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_simple_upsert__rest.yaml +270 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert__rest.yaml +267 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert_complex_external_id_field__rest.yaml +369 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert_complex_external_id_field_rest__duplicate_error.yaml +204 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert_complex_fields__bulk.yaml +675 -0
- cumulusci/tasks/bulkdata/tests/dummy_data_factory.py +36 -0
- cumulusci/tasks/bulkdata/tests/integration_test_utils.py +49 -0
- cumulusci/tasks/bulkdata/tests/mapping-oid.yml +87 -0
- cumulusci/tasks/bulkdata/tests/mapping_after.yml +38 -0
- cumulusci/tasks/bulkdata/tests/mapping_poly.yml +34 -0
- cumulusci/tasks/bulkdata/tests/mapping_poly_incomplete.yml +20 -0
- cumulusci/tasks/bulkdata/tests/mapping_poly_wrong.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select.yml +20 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_strategy.yml +20 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_threshold__invalid_number.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_threshold__invalid_strategy.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_threshold__non_float.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_missing_priority_fields.yml +22 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_no_priority_fields.yml +18 -0
- cumulusci/tasks/bulkdata/tests/mapping_simple.yml +27 -0
- cumulusci/tasks/bulkdata/tests/mapping_v1.yml +28 -0
- cumulusci/tasks/bulkdata/tests/mapping_v2.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_v3.yml +32 -0
- cumulusci/tasks/bulkdata/tests/mapping_vanilla_sf.yml +69 -0
- cumulusci/tasks/bulkdata/tests/mock_data_factory_without_mapping.py +12 -0
- cumulusci/tasks/bulkdata/tests/person_accounts.yml +23 -0
- cumulusci/tasks/bulkdata/tests/person_accounts_minimal.yml +15 -0
- cumulusci/tasks/bulkdata/tests/recordtypes.yml +8 -0
- cumulusci/tasks/bulkdata/tests/recordtypes_2.yml +6 -0
- cumulusci/tasks/bulkdata/tests/recordtypes_with_ispersontype.yml +8 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/child/child2.yml +3 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/child.yml +4 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/gen_npsp_standard_objects.recipe.yml +89 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/include_parent.yml +3 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/npsp_standard_objects_macros.yml +34 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/options.recipe.yml +6 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/query_snowfakery.recipe.yml +16 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/sf_standard_object_macros.yml +83 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery.load.yml +2 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery.recipe.yml +13 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_2.load.yml +5 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_channels.load.yml +13 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_channels.recipe.yml +12 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_channels_2.load.yml +13 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/unique_values.recipe.yml +4 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/upsert.recipe.yml +23 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/upsert_2.recipe.yml +29 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/upsert_before.yml +10 -0
- cumulusci/tasks/bulkdata/tests/test_base_generate_data_tasks.py +61 -0
- cumulusci/tasks/bulkdata/tests/test_dates.py +99 -0
- cumulusci/tasks/bulkdata/tests/test_delete.py +404 -0
- cumulusci/tasks/bulkdata/tests/test_extract.py +1311 -0
- cumulusci/tasks/bulkdata/tests/test_factory_utils.py +55 -0
- cumulusci/tasks/bulkdata/tests/test_generate_and_load.py +252 -0
- cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py +343 -0
- cumulusci/tasks/bulkdata/tests/test_generatemapping.py +1039 -0
- cumulusci/tasks/bulkdata/tests/test_load.py +3175 -0
- cumulusci/tasks/bulkdata/tests/test_mapping_parser.py +1658 -0
- cumulusci/tasks/bulkdata/tests/test_query_db__joins_self_lookups.yml +12 -0
- cumulusci/tasks/bulkdata/tests/test_query_db_joins_lookups.yml +26 -0
- cumulusci/tasks/bulkdata/tests/test_query_db_joins_lookups_select.yml +48 -0
- cumulusci/tasks/bulkdata/tests/test_select.py +171 -0
- cumulusci/tasks/bulkdata/tests/test_select_utils.py +1057 -0
- cumulusci/tasks/bulkdata/tests/test_snowfakery.py +1153 -0
- cumulusci/tasks/bulkdata/tests/test_step.py +3957 -0
- cumulusci/tasks/bulkdata/tests/test_updates.py +513 -0
- cumulusci/tasks/bulkdata/tests/test_upsert.py +1015 -0
- cumulusci/tasks/bulkdata/tests/test_utils.py +158 -0
- cumulusci/tasks/bulkdata/tests/testdata.db +0 -0
- cumulusci/tasks/bulkdata/tests/update_describe.py +50 -0
- cumulusci/tasks/bulkdata/tests/update_person_accounts.yml +23 -0
- cumulusci/tasks/bulkdata/tests/utils.py +114 -0
- cumulusci/tasks/bulkdata/update_data.py +260 -0
- cumulusci/tasks/bulkdata/upsert_utils.py +130 -0
- cumulusci/tasks/bulkdata/utils.py +249 -0
- cumulusci/tasks/command.py +178 -0
- cumulusci/tasks/connectedapp.py +186 -0
- cumulusci/tasks/create_package_version.py +778 -0
- cumulusci/tasks/datadictionary.py +745 -0
- cumulusci/tasks/dx_convert_from.py +26 -0
- cumulusci/tasks/github/__init__.py +17 -0
- cumulusci/tasks/github/base.py +16 -0
- cumulusci/tasks/github/commit_status.py +13 -0
- cumulusci/tasks/github/merge.py +11 -0
- cumulusci/tasks/github/publish.py +11 -0
- cumulusci/tasks/github/pull_request.py +11 -0
- cumulusci/tasks/github/release.py +11 -0
- cumulusci/tasks/github/release_report.py +11 -0
- cumulusci/tasks/github/tag.py +11 -0
- cumulusci/tasks/github/tests/__init__.py +0 -0
- cumulusci/tasks/github/tests/test_util.py +202 -0
- cumulusci/tasks/github/tests/test_vcs_migration.py +44 -0
- cumulusci/tasks/github/tests/util_github_api.py +666 -0
- cumulusci/tasks/github/util.py +252 -0
- cumulusci/tasks/marketing_cloud/__init__.py +0 -0
- cumulusci/tasks/marketing_cloud/api.py +188 -0
- cumulusci/tasks/marketing_cloud/base.py +38 -0
- cumulusci/tasks/marketing_cloud/deploy.py +345 -0
- cumulusci/tasks/marketing_cloud/get_user_info.py +40 -0
- cumulusci/tasks/marketing_cloud/mc_constants.py +1 -0
- cumulusci/tasks/marketing_cloud/tests/__init__.py +0 -0
- cumulusci/tasks/marketing_cloud/tests/conftest.py +46 -0
- cumulusci/tasks/marketing_cloud/tests/expected-payload.json +110 -0
- cumulusci/tasks/marketing_cloud/tests/test_api.py +97 -0
- cumulusci/tasks/marketing_cloud/tests/test_api_soap_envelopes.py +145 -0
- cumulusci/tasks/marketing_cloud/tests/test_base.py +14 -0
- cumulusci/tasks/marketing_cloud/tests/test_deploy.py +400 -0
- cumulusci/tasks/marketing_cloud/tests/test_get_user_info.py +141 -0
- cumulusci/tasks/marketing_cloud/tests/validation-response.json +39 -0
- cumulusci/tasks/metadata/__init__.py +0 -0
- cumulusci/tasks/metadata/ee_src.py +94 -0
- cumulusci/tasks/metadata/managed_src.py +100 -0
- cumulusci/tasks/metadata/metadata_map.yml +868 -0
- cumulusci/tasks/metadata/modify.py +99 -0
- cumulusci/tasks/metadata/package.py +684 -0
- cumulusci/tasks/metadata/tests/__init__.py +0 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/.hidden/.keep +0 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/destructiveChanges.xml +9 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/package.xml +9 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/package_install_uninstall.xml +11 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/reports/namespace__TestFolder/TestReport.report +3 -0
- cumulusci/tasks/metadata/tests/sample_package.xml +9 -0
- cumulusci/tasks/metadata/tests/test_ee_src.py +112 -0
- cumulusci/tasks/metadata/tests/test_managed_src.py +111 -0
- cumulusci/tasks/metadata/tests/test_modify.py +123 -0
- cumulusci/tasks/metadata/tests/test_package.py +476 -0
- cumulusci/tasks/metadata_etl/__init__.py +29 -0
- cumulusci/tasks/metadata_etl/base.py +436 -0
- cumulusci/tasks/metadata_etl/duplicate_rules.py +24 -0
- cumulusci/tasks/metadata_etl/field_sets.py +70 -0
- cumulusci/tasks/metadata_etl/help_text.py +92 -0
- cumulusci/tasks/metadata_etl/layouts.py +550 -0
- cumulusci/tasks/metadata_etl/objects.py +68 -0
- cumulusci/tasks/metadata_etl/permissions.py +167 -0
- cumulusci/tasks/metadata_etl/picklists.py +221 -0
- cumulusci/tasks/metadata_etl/remote_site_settings.py +99 -0
- cumulusci/tasks/metadata_etl/sharing.py +138 -0
- cumulusci/tasks/metadata_etl/tests/test_base.py +512 -0
- cumulusci/tasks/metadata_etl/tests/test_duplicate_rules.py +22 -0
- cumulusci/tasks/metadata_etl/tests/test_field_sets.py +156 -0
- cumulusci/tasks/metadata_etl/tests/test_help_text.py +387 -0
- cumulusci/tasks/metadata_etl/tests/test_ip_ranges.py +85 -0
- cumulusci/tasks/metadata_etl/tests/test_layouts.py +858 -0
- cumulusci/tasks/metadata_etl/tests/test_objects.py +236 -0
- cumulusci/tasks/metadata_etl/tests/test_permissions.py +223 -0
- cumulusci/tasks/metadata_etl/tests/test_picklists.py +547 -0
- cumulusci/tasks/metadata_etl/tests/test_remote_site_settings.py +46 -0
- cumulusci/tasks/metadata_etl/tests/test_sharing.py +333 -0
- cumulusci/tasks/metadata_etl/tests/test_value_sets.py +298 -0
- cumulusci/tasks/metadata_etl/value_sets.py +106 -0
- cumulusci/tasks/metadeploy.py +393 -0
- cumulusci/tasks/metaxml.py +88 -0
- cumulusci/tasks/preflight/__init__.py +0 -0
- cumulusci/tasks/preflight/dataset_load.py +49 -0
- cumulusci/tasks/preflight/licenses.py +86 -0
- cumulusci/tasks/preflight/packages.py +14 -0
- cumulusci/tasks/preflight/permsets.py +23 -0
- cumulusci/tasks/preflight/recordtypes.py +16 -0
- cumulusci/tasks/preflight/retrieve_tasks.py +30 -0
- cumulusci/tasks/preflight/settings.py +77 -0
- cumulusci/tasks/preflight/sobjects.py +202 -0
- cumulusci/tasks/preflight/tests/test_dataset_load.py +85 -0
- cumulusci/tasks/preflight/tests/test_licenses.py +174 -0
- cumulusci/tasks/preflight/tests/test_packages.py +14 -0
- cumulusci/tasks/preflight/tests/test_permset_preflights.py +51 -0
- cumulusci/tasks/preflight/tests/test_recordtypes.py +30 -0
- cumulusci/tasks/preflight/tests/test_retrieve_tasks.py +62 -0
- cumulusci/tasks/preflight/tests/test_settings.py +130 -0
- cumulusci/tasks/preflight/tests/test_sobjects.py +231 -0
- cumulusci/tasks/push/README.md +59 -0
- cumulusci/tasks/push/__init__.py +0 -0
- cumulusci/tasks/push/push_api.py +659 -0
- cumulusci/tasks/push/pushfails.py +136 -0
- cumulusci/tasks/push/tasks.py +476 -0
- cumulusci/tasks/push/tests/conftest.py +263 -0
- cumulusci/tasks/push/tests/test_push_api.py +951 -0
- cumulusci/tasks/push/tests/test_push_tasks.py +659 -0
- cumulusci/tasks/release_notes/README.md +63 -0
- cumulusci/tasks/release_notes/__init__.py +0 -0
- cumulusci/tasks/release_notes/exceptions.py +5 -0
- cumulusci/tasks/release_notes/generator.py +137 -0
- cumulusci/tasks/release_notes/parser.py +232 -0
- cumulusci/tasks/release_notes/provider.py +44 -0
- cumulusci/tasks/release_notes/task.py +300 -0
- cumulusci/tasks/release_notes/tests/__init__.py +0 -0
- cumulusci/tasks/release_notes/tests/change_notes/full/example1.md +17 -0
- cumulusci/tasks/release_notes/tests/change_notes/multi/1.txt +1 -0
- cumulusci/tasks/release_notes/tests/change_notes/multi/2.txt +1 -0
- cumulusci/tasks/release_notes/tests/change_notes/multi/3.txt +1 -0
- cumulusci/tasks/release_notes/tests/change_notes/single/1.txt +1 -0
- cumulusci/tasks/release_notes/tests/test_generator.py +582 -0
- cumulusci/tasks/release_notes/tests/test_parser.py +867 -0
- cumulusci/tasks/release_notes/tests/test_provider.py +512 -0
- cumulusci/tasks/release_notes/tests/test_task.py +461 -0
- cumulusci/tasks/release_notes/tests/utils.py +153 -0
- cumulusci/tasks/robotframework/__init__.py +3 -0
- cumulusci/tasks/robotframework/debugger/DebugListener.py +100 -0
- cumulusci/tasks/robotframework/debugger/__init__.py +10 -0
- cumulusci/tasks/robotframework/debugger/model.py +87 -0
- cumulusci/tasks/robotframework/debugger/ui.py +259 -0
- cumulusci/tasks/robotframework/libdoc.py +269 -0
- cumulusci/tasks/robotframework/robotframework.py +392 -0
- cumulusci/tasks/robotframework/stylesheet.css +130 -0
- cumulusci/tasks/robotframework/template.html +109 -0
- cumulusci/tasks/robotframework/tests/TestLibrary.py +18 -0
- cumulusci/tasks/robotframework/tests/TestPageObjects.py +31 -0
- cumulusci/tasks/robotframework/tests/TestResource.robot +8 -0
- cumulusci/tasks/robotframework/tests/failing_tests.robot +16 -0
- cumulusci/tasks/robotframework/tests/performance.robot +23 -0
- cumulusci/tasks/robotframework/tests/test_browser_proxies.py +137 -0
- cumulusci/tasks/robotframework/tests/test_debugger.py +360 -0
- cumulusci/tasks/robotframework/tests/test_robot_parallel.py +141 -0
- cumulusci/tasks/robotframework/tests/test_robotframework.py +860 -0
- cumulusci/tasks/salesforce/BaseRetrieveMetadata.py +58 -0
- cumulusci/tasks/salesforce/BaseSalesforceApiTask.py +45 -0
- cumulusci/tasks/salesforce/BaseSalesforceMetadataApiTask.py +18 -0
- cumulusci/tasks/salesforce/BaseSalesforceTask.py +4 -0
- cumulusci/tasks/salesforce/BaseUninstallMetadata.py +41 -0
- cumulusci/tasks/salesforce/CreateCommunity.py +124 -0
- cumulusci/tasks/salesforce/CreatePackage.py +29 -0
- cumulusci/tasks/salesforce/Deploy.py +240 -0
- cumulusci/tasks/salesforce/DeployBundles.py +88 -0
- cumulusci/tasks/salesforce/DescribeMetadataTypes.py +26 -0
- cumulusci/tasks/salesforce/EnsureRecordTypes.py +202 -0
- cumulusci/tasks/salesforce/GetInstalledPackages.py +8 -0
- cumulusci/tasks/salesforce/ListCommunities.py +40 -0
- cumulusci/tasks/salesforce/ListCommunityTemplates.py +19 -0
- cumulusci/tasks/salesforce/PublishCommunity.py +62 -0
- cumulusci/tasks/salesforce/RetrievePackaged.py +41 -0
- cumulusci/tasks/salesforce/RetrieveReportsAndDashboards.py +82 -0
- cumulusci/tasks/salesforce/RetrieveUnpackaged.py +36 -0
- cumulusci/tasks/salesforce/SOQLQuery.py +39 -0
- cumulusci/tasks/salesforce/UninstallLocal.py +15 -0
- cumulusci/tasks/salesforce/UninstallLocalBundles.py +28 -0
- cumulusci/tasks/salesforce/UninstallLocalNamespacedBundles.py +58 -0
- cumulusci/tasks/salesforce/UninstallPackage.py +32 -0
- cumulusci/tasks/salesforce/UninstallPackaged.py +56 -0
- cumulusci/tasks/salesforce/UpdateAdminProfile.py +8 -0
- cumulusci/tasks/salesforce/__init__.py +79 -0
- cumulusci/tasks/salesforce/activate_flow.py +74 -0
- cumulusci/tasks/salesforce/check_components.py +324 -0
- cumulusci/tasks/salesforce/composite.py +142 -0
- cumulusci/tasks/salesforce/create_permission_sets.py +35 -0
- cumulusci/tasks/salesforce/custom_settings.py +134 -0
- cumulusci/tasks/salesforce/custom_settings_wait.py +132 -0
- cumulusci/tasks/salesforce/enable_prediction.py +107 -0
- cumulusci/tasks/salesforce/insert_record.py +40 -0
- cumulusci/tasks/salesforce/install_package_version.py +242 -0
- cumulusci/tasks/salesforce/license_preflights.py +8 -0
- cumulusci/tasks/salesforce/network_member_group.py +178 -0
- cumulusci/tasks/salesforce/nonsourcetracking.py +228 -0
- cumulusci/tasks/salesforce/org_settings.py +193 -0
- cumulusci/tasks/salesforce/package_upload.py +328 -0
- cumulusci/tasks/salesforce/profiles.py +74 -0
- cumulusci/tasks/salesforce/promote_package_version.py +376 -0
- cumulusci/tasks/salesforce/retrieve_profile.py +195 -0
- cumulusci/tasks/salesforce/salesforce_files.py +244 -0
- cumulusci/tasks/salesforce/sourcetracking.py +507 -0
- cumulusci/tasks/salesforce/tests/__init__.py +3 -0
- cumulusci/tasks/salesforce/tests/test_CreateCommunity.py +278 -0
- cumulusci/tasks/salesforce/tests/test_CreatePackage.py +22 -0
- cumulusci/tasks/salesforce/tests/test_Deploy.py +470 -0
- cumulusci/tasks/salesforce/tests/test_DeployBundles.py +76 -0
- cumulusci/tasks/salesforce/tests/test_EnsureRecordTypes.py +345 -0
- cumulusci/tasks/salesforce/tests/test_ListCommunities.py +84 -0
- cumulusci/tasks/salesforce/tests/test_ListCommunityTemplates.py +49 -0
- cumulusci/tasks/salesforce/tests/test_PackageUpload.py +547 -0
- cumulusci/tasks/salesforce/tests/test_ProfileGrantAllAccess.py +699 -0
- cumulusci/tasks/salesforce/tests/test_PublishCommunity.py +181 -0
- cumulusci/tasks/salesforce/tests/test_RetrievePackaged.py +24 -0
- cumulusci/tasks/salesforce/tests/test_RetrieveReportsAndDashboards.py +56 -0
- cumulusci/tasks/salesforce/tests/test_RetrieveUnpackaged.py +21 -0
- cumulusci/tasks/salesforce/tests/test_SOQLQuery.py +30 -0
- cumulusci/tasks/salesforce/tests/test_UninstallLocal.py +15 -0
- cumulusci/tasks/salesforce/tests/test_UninstallLocalBundles.py +19 -0
- cumulusci/tasks/salesforce/tests/test_UninstallLocalNamespacedBundles.py +22 -0
- cumulusci/tasks/salesforce/tests/test_UninstallPackage.py +19 -0
- cumulusci/tasks/salesforce/tests/test_UninstallPackaged.py +66 -0
- cumulusci/tasks/salesforce/tests/test_UninstallPackagedIncremental.py +127 -0
- cumulusci/tasks/salesforce/tests/test_activate_flow.py +132 -0
- cumulusci/tasks/salesforce/tests/test_base_tasks.py +110 -0
- cumulusci/tasks/salesforce/tests/test_check_components.py +445 -0
- cumulusci/tasks/salesforce/tests/test_composite.py +250 -0
- cumulusci/tasks/salesforce/tests/test_create_permission_sets.py +41 -0
- cumulusci/tasks/salesforce/tests/test_custom_settings.py +227 -0
- cumulusci/tasks/salesforce/tests/test_custom_settings_wait.py +174 -0
- cumulusci/tasks/salesforce/tests/test_describemetadatatypes.py +18 -0
- cumulusci/tasks/salesforce/tests/test_enable_prediction.py +240 -0
- cumulusci/tasks/salesforce/tests/test_insert_record.py +110 -0
- cumulusci/tasks/salesforce/tests/test_install_package_version.py +464 -0
- cumulusci/tasks/salesforce/tests/test_network_member_group.py +444 -0
- cumulusci/tasks/salesforce/tests/test_nonsourcetracking.py +235 -0
- cumulusci/tasks/salesforce/tests/test_org_settings.py +407 -0
- cumulusci/tasks/salesforce/tests/test_profiles.py +202 -0
- cumulusci/tasks/salesforce/tests/test_retrieve_profile.py +287 -0
- cumulusci/tasks/salesforce/tests/test_salesforce_files.py +228 -0
- cumulusci/tasks/salesforce/tests/test_sourcetracking.py +350 -0
- cumulusci/tasks/salesforce/tests/test_trigger_handlers.py +300 -0
- cumulusci/tasks/salesforce/tests/test_update_dependencies.py +509 -0
- cumulusci/tasks/salesforce/tests/util.py +79 -0
- cumulusci/tasks/salesforce/trigger_handlers.py +119 -0
- cumulusci/tasks/salesforce/uninstall_packaged_incremental.py +136 -0
- cumulusci/tasks/salesforce/update_dependencies.py +290 -0
- cumulusci/tasks/salesforce/update_profile.py +339 -0
- cumulusci/tasks/salesforce/users/permsets.py +227 -0
- cumulusci/tasks/salesforce/users/photos.py +162 -0
- cumulusci/tasks/salesforce/users/tests/photo.mock.txt +1 -0
- cumulusci/tasks/salesforce/users/tests/test_permsets.py +950 -0
- cumulusci/tasks/salesforce/users/tests/test_photos.py +373 -0
- cumulusci/tasks/sample_data/capture_sample_data.py +77 -0
- cumulusci/tasks/sample_data/load_sample_data.py +85 -0
- cumulusci/tasks/sample_data/test_capture_sample_data.py +117 -0
- cumulusci/tasks/sample_data/test_load_sample_data.py +121 -0
- cumulusci/tasks/sfdx.py +83 -0
- cumulusci/tasks/tests/__init__.py +1 -0
- cumulusci/tasks/tests/conftest.py +30 -0
- cumulusci/tasks/tests/test_command.py +129 -0
- cumulusci/tasks/tests/test_connectedapp.py +236 -0
- cumulusci/tasks/tests/test_create_package_version.py +847 -0
- cumulusci/tasks/tests/test_datadictionary.py +1575 -0
- cumulusci/tasks/tests/test_dx_convert_from.py +60 -0
- cumulusci/tasks/tests/test_metadeploy.py +624 -0
- cumulusci/tasks/tests/test_metaxml.py +99 -0
- cumulusci/tasks/tests/test_promote_package_version.py +488 -0
- cumulusci/tasks/tests/test_pushfails.py +96 -0
- cumulusci/tasks/tests/test_salesforce.py +72 -0
- cumulusci/tasks/tests/test_sfdx.py +105 -0
- cumulusci/tasks/tests/test_util.py +207 -0
- cumulusci/tasks/util.py +261 -0
- cumulusci/tasks/vcs/__init__.py +19 -0
- cumulusci/tasks/vcs/commit_status.py +58 -0
- cumulusci/tasks/vcs/create_commit_status.py +37 -0
- cumulusci/tasks/vcs/download_extract.py +199 -0
- cumulusci/tasks/vcs/merge.py +298 -0
- cumulusci/tasks/vcs/publish.py +207 -0
- cumulusci/tasks/vcs/pull_request.py +9 -0
- cumulusci/tasks/vcs/release.py +134 -0
- cumulusci/tasks/vcs/release_report.py +105 -0
- cumulusci/tasks/vcs/tag.py +31 -0
- cumulusci/tasks/vcs/tests/github/test_commit_status.py +196 -0
- cumulusci/tasks/vcs/tests/github/test_download_extract.py +896 -0
- cumulusci/tasks/vcs/tests/github/test_merge.py +1118 -0
- cumulusci/tasks/vcs/tests/github/test_publish.py +823 -0
- cumulusci/tasks/vcs/tests/github/test_pull_request.py +29 -0
- cumulusci/tasks/vcs/tests/github/test_release.py +390 -0
- cumulusci/tasks/vcs/tests/github/test_release_report.py +109 -0
- cumulusci/tasks/vcs/tests/github/test_tag.py +90 -0
- cumulusci/tasks/vlocity/exceptions.py +2 -0
- cumulusci/tasks/vlocity/tests/test_vlocity.py +283 -0
- cumulusci/tasks/vlocity/vlocity.py +342 -0
- cumulusci/tests/__init__.py +1 -0
- cumulusci/tests/cassettes/GET_sobjects_Account_PersonAccount_describe.yaml +18 -0
- cumulusci/tests/cassettes/TestIntegrationInfrastructure.test_integration_tests.yaml +19 -0
- cumulusci/tests/pytest_plugins/pytest_sf_orgconnect.py +307 -0
- cumulusci/tests/pytest_plugins/pytest_sf_vcr.py +275 -0
- cumulusci/tests/pytest_plugins/pytest_sf_vcr_serializer.py +160 -0
- cumulusci/tests/pytest_plugins/pytest_typeguard.py +5 -0
- cumulusci/tests/pytest_plugins/test_vcr_string_compressor.py +49 -0
- cumulusci/tests/pytest_plugins/vcr_string_compressor.py +97 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Account_describe.yaml +18 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Case_describe.yaml +18 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Contact_describe.yaml +4838 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Custom__c_describe.yaml +242 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Event_describe.yaml +19 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Global_describe.yaml +1338 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Lead_describe.yaml +18 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_OpportunityContactRole_describe.yaml +34 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Opportunity_describe.yaml +1261 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Organization.yaml +49 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/batchInfoList_xml.tpl +15 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/batchInfo_xml.tpl +13 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/jobInfo_insert_xml.tpl +24 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/jobInfo_upsert_xml.tpl +25 -0
- cumulusci/tests/test_entry_points.py +20 -0
- cumulusci/tests/test_integration_infrastructure.py +131 -0
- cumulusci/tests/test_main.py +9 -0
- cumulusci/tests/test_schema.py +32 -0
- cumulusci/tests/test_utils.py +657 -0
- cumulusci/tests/test_vcr_serializer.py +134 -0
- cumulusci/tests/uncompressed_cassette.yaml +83 -0
- cumulusci/tests/util.py +344 -0
- cumulusci/utils/__init__.py +731 -0
- cumulusci/utils/classutils.py +9 -0
- cumulusci/utils/collections.py +32 -0
- cumulusci/utils/deprecation.py +11 -0
- cumulusci/utils/encryption.py +31 -0
- cumulusci/utils/fileutils.py +295 -0
- cumulusci/utils/git.py +142 -0
- cumulusci/utils/http/multi_request.py +214 -0
- cumulusci/utils/http/requests_utils.py +103 -0
- cumulusci/utils/http/tests/cassettes/ManualEditTestCompositeParallelSalesforce.test_http_headers.yaml +32 -0
- cumulusci/utils/http/tests/cassettes/TestCompositeParallelSalesforce.test_composite_parallel_salesforce.yaml +65 -0
- cumulusci/utils/http/tests/cassettes/TestCompositeParallelSalesforce.test_errors.yaml +24 -0
- cumulusci/utils/http/tests/cassettes/TestCompositeParallelSalesforce.test_reference_ids.yaml +49 -0
- cumulusci/utils/http/tests/test_multi_request.py +255 -0
- cumulusci/utils/iterators.py +21 -0
- cumulusci/utils/logging.py +128 -0
- cumulusci/utils/metaprogramming.py +10 -0
- cumulusci/utils/options.py +138 -0
- cumulusci/utils/parallel/queries_in_parallel/run_queries_in_parallel.py +29 -0
- cumulusci/utils/parallel/queries_in_parallel/tests/test_run_queries_in_parallel.py +50 -0
- cumulusci/utils/parallel/task_worker_queues/parallel_worker.py +238 -0
- cumulusci/utils/parallel/task_worker_queues/parallel_worker_queue.py +243 -0
- cumulusci/utils/parallel/task_worker_queues/tests/test_parallel_worker.py +353 -0
- cumulusci/utils/salesforce/count_sobjects.py +46 -0
- cumulusci/utils/salesforce/soql.py +17 -0
- cumulusci/utils/salesforce/tests/cassettes/ManualEdit_TestCountSObjects.test_count_sobjects__network_errors.yaml +23 -0
- cumulusci/utils/salesforce/tests/cassettes/TestCountSObjects.test_count_sobjects__errors.yaml +33 -0
- cumulusci/utils/salesforce/tests/cassettes/TestCountSObjects.test_count_sobjects_simple.yaml +29 -0
- cumulusci/utils/salesforce/tests/test_count_sobjects.py +29 -0
- cumulusci/utils/salesforce/tests/test_soql.py +30 -0
- cumulusci/utils/tests/cassettes/ManualEditTestDescribeOrg.test_minimal_schema.yaml +36 -0
- cumulusci/utils/tests/cassettes/ManualEdit_test_describe_to_sql.yaml +191 -0
- cumulusci/utils/tests/test_fileutils.py +284 -0
- cumulusci/utils/tests/test_git.py +85 -0
- cumulusci/utils/tests/test_logging.py +70 -0
- cumulusci/utils/tests/test_option_parsing.py +188 -0
- cumulusci/utils/tests/test_org_schema.py +691 -0
- cumulusci/utils/tests/test_org_schema_models.py +79 -0
- cumulusci/utils/tests/test_waiting.py +25 -0
- cumulusci/utils/version_strings.py +391 -0
- cumulusci/utils/waiting.py +42 -0
- cumulusci/utils/xml/__init__.py +91 -0
- cumulusci/utils/xml/metadata_tree.py +299 -0
- cumulusci/utils/xml/robot_xml.py +114 -0
- cumulusci/utils/xml/salesforce_encoding.py +100 -0
- cumulusci/utils/xml/test/test_metadata_tree.py +251 -0
- cumulusci/utils/xml/test/test_salesforce_encoding.py +173 -0
- cumulusci/utils/yaml/cumulusci_yml.py +401 -0
- cumulusci/utils/yaml/model_parser.py +156 -0
- cumulusci/utils/yaml/safer_loader.py +74 -0
- cumulusci/utils/yaml/tests/bad_cci.yml +5 -0
- cumulusci/utils/yaml/tests/cassettes/TestCumulusciYml.test_validate_url__with_errors.yaml +20 -0
- cumulusci/utils/yaml/tests/test_cumulusci_yml.py +286 -0
- cumulusci/utils/yaml/tests/test_model_parser.py +175 -0
- cumulusci/utils/yaml/tests/test_safer_loader.py +88 -0
- cumulusci/utils/ziputils.py +61 -0
- cumulusci/vcs/base.py +143 -0
- cumulusci/vcs/bootstrap.py +272 -0
- cumulusci/vcs/github/__init__.py +24 -0
- cumulusci/vcs/github/adapter.py +689 -0
- cumulusci/vcs/github/release_notes/generator.py +219 -0
- cumulusci/vcs/github/release_notes/parser.py +151 -0
- cumulusci/vcs/github/release_notes/provider.py +143 -0
- cumulusci/vcs/github/service.py +569 -0
- cumulusci/vcs/github/tests/test_adapter.py +138 -0
- cumulusci/vcs/github/tests/test_service.py +408 -0
- cumulusci/vcs/models.py +586 -0
- cumulusci/vcs/tests/conftest.py +41 -0
- cumulusci/vcs/tests/dummy_service.py +241 -0
- cumulusci/vcs/tests/test_vcs_base.py +687 -0
- cumulusci/vcs/tests/test_vcs_bootstrap.py +727 -0
- cumulusci/vcs/utils/__init__.py +31 -0
- cumulusci/vcs/vcs_source.py +287 -0
- cumulusci_plus-5.0.0.dist-info/METADATA +145 -0
- cumulusci_plus-5.0.0.dist-info/RECORD +744 -0
- cumulusci_plus-5.0.0.dist-info/WHEEL +4 -0
- cumulusci_plus-5.0.0.dist-info/entry_points.txt +3 -0
- cumulusci_plus-5.0.0.dist-info/licenses/AUTHORS.rst +41 -0
- cumulusci_plus-5.0.0.dist-info/licenses/LICENSE +30 -0
|
@@ -0,0 +1,1575 @@
|
|
|
1
|
+
import io
|
|
2
|
+
from collections import defaultdict
|
|
3
|
+
from unittest.mock import Mock, call, mock_open, patch
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from cumulusci.core.config.project_config import BaseProjectConfig
|
|
8
|
+
from cumulusci.core.dependencies import parse_dependencies
|
|
9
|
+
from cumulusci.core.dependencies.github import GitHubDynamicDependency
|
|
10
|
+
from cumulusci.core.exceptions import (
|
|
11
|
+
DependencyParseError,
|
|
12
|
+
DependencyResolutionError,
|
|
13
|
+
TaskOptionsError,
|
|
14
|
+
)
|
|
15
|
+
from cumulusci.tasks.datadictionary import (
|
|
16
|
+
PRERELEASE_SIGIL,
|
|
17
|
+
FieldDetail,
|
|
18
|
+
GenerateDataDictionary,
|
|
19
|
+
Package,
|
|
20
|
+
PackageVersion,
|
|
21
|
+
SObjectDetail,
|
|
22
|
+
)
|
|
23
|
+
from cumulusci.tasks.salesforce.tests.util import create_task
|
|
24
|
+
from cumulusci.tests.util import create_project_config
|
|
25
|
+
from cumulusci.utils import temporary_dir
|
|
26
|
+
from cumulusci.utils.version_strings import LooseVersion
|
|
27
|
+
from cumulusci.utils.xml import metadata_tree
|
|
28
|
+
from cumulusci.utils.yaml.cumulusci_yml import cci_safe_load
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TestGenerateDataDictionary:
|
|
32
|
+
def test_version_from_tag_name(self):
|
|
33
|
+
task = create_task(GenerateDataDictionary, {})
|
|
34
|
+
|
|
35
|
+
assert task._version_from_tag_name("release/1.1", "release/") == LooseVersion(
|
|
36
|
+
"1.1"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def test_write_object_results(self):
|
|
40
|
+
task = create_task(GenerateDataDictionary, {})
|
|
41
|
+
|
|
42
|
+
p = Package(
|
|
43
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
44
|
+
)
|
|
45
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
46
|
+
v2 = PackageVersion(package=p, version=LooseVersion("1.2"))
|
|
47
|
+
task.package_versions = defaultdict(list)
|
|
48
|
+
task.package_versions[p] = [v2.version, v.version]
|
|
49
|
+
task.sobjects = defaultdict(list)
|
|
50
|
+
task.sobjects["test__Test__c"] = [
|
|
51
|
+
SObjectDetail(
|
|
52
|
+
version=v,
|
|
53
|
+
api_name="test__Test__c",
|
|
54
|
+
label="Test",
|
|
55
|
+
description="Description",
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
f = io.StringIO()
|
|
60
|
+
task._write_object_results(f)
|
|
61
|
+
|
|
62
|
+
f.seek(0)
|
|
63
|
+
result = f.read()
|
|
64
|
+
|
|
65
|
+
assert (
|
|
66
|
+
result
|
|
67
|
+
== '"Object Label","Object API Name","Object Description","Version Introduced","Version Deleted"\r\n"Test","test__Test__c","Description","Test 1.1","Test 1.2"\r\n'
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def test_write_field_results(self):
|
|
71
|
+
task = create_task(GenerateDataDictionary, {})
|
|
72
|
+
|
|
73
|
+
p = Package(
|
|
74
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
75
|
+
)
|
|
76
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
77
|
+
v2 = PackageVersion(package=p, version=LooseVersion("1.2"))
|
|
78
|
+
|
|
79
|
+
task._init_schema()
|
|
80
|
+
task.package_versions[p] = [v2.version, v.version]
|
|
81
|
+
task.sobjects["test__Test__c"] = [
|
|
82
|
+
SObjectDetail(
|
|
83
|
+
version=v,
|
|
84
|
+
api_name="test__Test__c",
|
|
85
|
+
label="Test Object",
|
|
86
|
+
description="Desc",
|
|
87
|
+
),
|
|
88
|
+
SObjectDetail(
|
|
89
|
+
version=v2,
|
|
90
|
+
api_name="test__Test__c",
|
|
91
|
+
label="Test Object",
|
|
92
|
+
description="Desc",
|
|
93
|
+
),
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
task.fields.update(
|
|
97
|
+
{
|
|
98
|
+
"Account.test__Desc__c": [
|
|
99
|
+
FieldDetail(
|
|
100
|
+
version=v2,
|
|
101
|
+
sobject="Account",
|
|
102
|
+
api_name="test__Desc__c",
|
|
103
|
+
label="Desc",
|
|
104
|
+
type="Text",
|
|
105
|
+
help_text="",
|
|
106
|
+
description="",
|
|
107
|
+
valid_values="",
|
|
108
|
+
)
|
|
109
|
+
],
|
|
110
|
+
"test__Test__c.test__Type__c": [
|
|
111
|
+
FieldDetail(
|
|
112
|
+
version=v,
|
|
113
|
+
sobject="test__Test__c",
|
|
114
|
+
api_name="test__Type__c",
|
|
115
|
+
label="Type",
|
|
116
|
+
type="Picklist",
|
|
117
|
+
help_text="Help",
|
|
118
|
+
description="Description",
|
|
119
|
+
valid_values="Foo; Bar",
|
|
120
|
+
),
|
|
121
|
+
FieldDetail(
|
|
122
|
+
version=v2,
|
|
123
|
+
sobject="test__Test__c",
|
|
124
|
+
api_name="test__Type__c",
|
|
125
|
+
label="Type",
|
|
126
|
+
type="Picklist",
|
|
127
|
+
help_text="New Help",
|
|
128
|
+
description="Description",
|
|
129
|
+
valid_values="Foo; Bar; New Value",
|
|
130
|
+
),
|
|
131
|
+
],
|
|
132
|
+
"test__Test__c.test__Account__c": [
|
|
133
|
+
FieldDetail(
|
|
134
|
+
version=v,
|
|
135
|
+
sobject="test__Test__c",
|
|
136
|
+
api_name="test__Account__c",
|
|
137
|
+
label="Account",
|
|
138
|
+
type="Lookup to Account",
|
|
139
|
+
help_text="Help",
|
|
140
|
+
description="Description",
|
|
141
|
+
valid_values="",
|
|
142
|
+
)
|
|
143
|
+
],
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
f = io.StringIO()
|
|
148
|
+
task._write_field_results(f)
|
|
149
|
+
f.seek(0)
|
|
150
|
+
result = f.read()
|
|
151
|
+
|
|
152
|
+
assert result == (
|
|
153
|
+
'"Object Label","Object API Name","Field Label","Field API Name",'
|
|
154
|
+
'"Type","Picklist Values","Help Text","Field Description","Version Introduced",'
|
|
155
|
+
'"Version Picklist Values Last Changed","Version Help Text Last Changed",'
|
|
156
|
+
'"Version Deleted"\r\n"Account","Account","Desc","test__Desc__c","Text",'
|
|
157
|
+
'"","","","Test 1.2","","",""\r\n"Test Object","test__Test__c","Type",'
|
|
158
|
+
'"test__Type__c","Picklist","Foo; Bar; New Value","New Help","Description",'
|
|
159
|
+
'"Test 1.1","Test 1.2","Test 1.2",""\r\n"Test Object","test__Test__c",'
|
|
160
|
+
'"Account","test__Account__c","Lookup to Account","","Help","Description",'
|
|
161
|
+
'"Test 1.1","","","Test 1.2"\r\n'
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
def test_write_field_results__omit_sobjects(self):
|
|
165
|
+
task = create_task(GenerateDataDictionary, {})
|
|
166
|
+
|
|
167
|
+
p = Package(
|
|
168
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
169
|
+
)
|
|
170
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
171
|
+
v2 = PackageVersion(package=p, version=LooseVersion("1.2"))
|
|
172
|
+
task._init_schema()
|
|
173
|
+
task.package_versions[p] = [v2.version, v.version]
|
|
174
|
+
task.omit_sobjects = set(["test__Test2__c"])
|
|
175
|
+
task.sobjects["test__Test__c"] = [
|
|
176
|
+
SObjectDetail(
|
|
177
|
+
version=v,
|
|
178
|
+
api_name="test__Test__c",
|
|
179
|
+
label="Test Object",
|
|
180
|
+
description="Desc",
|
|
181
|
+
),
|
|
182
|
+
SObjectDetail(
|
|
183
|
+
version=v2,
|
|
184
|
+
api_name="test__Test__c",
|
|
185
|
+
label="Test Object",
|
|
186
|
+
description="Desc",
|
|
187
|
+
),
|
|
188
|
+
]
|
|
189
|
+
task.fields["test__Test2__c.test__Blah__c"] = [
|
|
190
|
+
FieldDetail(
|
|
191
|
+
version=v,
|
|
192
|
+
sobject="test__Test2__c",
|
|
193
|
+
api_name="test__Blah__c",
|
|
194
|
+
label="Test Field",
|
|
195
|
+
type="Text",
|
|
196
|
+
help_text="Help",
|
|
197
|
+
description="Description",
|
|
198
|
+
valid_values="",
|
|
199
|
+
)
|
|
200
|
+
]
|
|
201
|
+
task.fields["test__Test__c.test__Type__c"] = [
|
|
202
|
+
FieldDetail(
|
|
203
|
+
version=v,
|
|
204
|
+
sobject="test__Test__c",
|
|
205
|
+
api_name="test__Type__c",
|
|
206
|
+
label="Type",
|
|
207
|
+
type="Picklist",
|
|
208
|
+
help_text="Help",
|
|
209
|
+
description="Description",
|
|
210
|
+
valid_values="Foo; Bar",
|
|
211
|
+
),
|
|
212
|
+
FieldDetail(
|
|
213
|
+
version=v2,
|
|
214
|
+
sobject="test__Test__c",
|
|
215
|
+
api_name="test__Type__c",
|
|
216
|
+
label="Type",
|
|
217
|
+
type="Picklist",
|
|
218
|
+
help_text="New Help",
|
|
219
|
+
description="Description",
|
|
220
|
+
valid_values="Foo; Bar; New Value",
|
|
221
|
+
),
|
|
222
|
+
]
|
|
223
|
+
task.fields["test__Test__c.test__Account__c"] = [
|
|
224
|
+
FieldDetail(
|
|
225
|
+
version=v,
|
|
226
|
+
sobject="test__Test__c",
|
|
227
|
+
api_name="test__Account__c",
|
|
228
|
+
label="Account",
|
|
229
|
+
type="Lookup to Account",
|
|
230
|
+
help_text="Help",
|
|
231
|
+
description="Description",
|
|
232
|
+
valid_values="",
|
|
233
|
+
)
|
|
234
|
+
]
|
|
235
|
+
|
|
236
|
+
f = io.StringIO()
|
|
237
|
+
task._write_field_results(f)
|
|
238
|
+
f.seek(0)
|
|
239
|
+
result = f.read()
|
|
240
|
+
|
|
241
|
+
assert result == (
|
|
242
|
+
'"Object Label","Object API Name","Field Label","Field API Name","Type",'
|
|
243
|
+
'"Picklist Values","Help Text","Field Description","Version Introduced",'
|
|
244
|
+
'"Version Picklist Values Last Changed","Version Help Text Last Changed",'
|
|
245
|
+
'"Version Deleted"\r\n"Test Object","test__Test__c","Type","test__Type__c",'
|
|
246
|
+
'"Picklist","Foo; Bar; New Value","New Help","Description","Test 1.1","Test 1.2",'
|
|
247
|
+
'"Test 1.2",""\r\n"Test Object","test__Test__c","Account","test__Account__c",'
|
|
248
|
+
'"Lookup to Account","","Help","Description","Test 1.1","","","Test 1.2"\r\n'
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
def test_should_process_object(self):
|
|
252
|
+
object_source_negative = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|
253
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
254
|
+
<description>Description</description>
|
|
255
|
+
<label>Test</label>
|
|
256
|
+
<visibility>Protected</visibility>
|
|
257
|
+
</CustomObject>"""
|
|
258
|
+
|
|
259
|
+
object_source_positive = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|
260
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
261
|
+
<description>Description</description>
|
|
262
|
+
<label>Test</label>
|
|
263
|
+
</CustomObject>"""
|
|
264
|
+
|
|
265
|
+
task = create_task(GenerateDataDictionary, {})
|
|
266
|
+
|
|
267
|
+
assert task._should_process_object(
|
|
268
|
+
"test__", "test__Obj__c", metadata_tree.fromstring(object_source_positive)
|
|
269
|
+
)
|
|
270
|
+
assert task._should_process_object("test__", "test__Obj__c", None)
|
|
271
|
+
assert task._should_process_object(
|
|
272
|
+
"test__", "test__Obj__e", metadata_tree.fromstring(object_source_positive)
|
|
273
|
+
)
|
|
274
|
+
assert not task._should_process_object(
|
|
275
|
+
"test__", "test__Obj__c", metadata_tree.fromstring(object_source_negative)
|
|
276
|
+
)
|
|
277
|
+
assert not task._should_process_object(
|
|
278
|
+
"test__", "foo__Obj__c", metadata_tree.fromstring(object_source_positive)
|
|
279
|
+
)
|
|
280
|
+
assert not task._should_process_object(
|
|
281
|
+
"test__", "Account", metadata_tree.fromstring(object_source_positive)
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
def test_should_process_object_fields(self):
|
|
285
|
+
object_source_negative = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|
286
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
287
|
+
<visibility>Protected</visibility>
|
|
288
|
+
<description>Description</description>
|
|
289
|
+
<label>Test</label>
|
|
290
|
+
</CustomObject>"""
|
|
291
|
+
|
|
292
|
+
object_source_positive = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|
293
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
294
|
+
<description>Description</description>
|
|
295
|
+
<label>Test</label>
|
|
296
|
+
</CustomObject>"""
|
|
297
|
+
|
|
298
|
+
task = create_task(GenerateDataDictionary, {})
|
|
299
|
+
|
|
300
|
+
assert task._should_process_object_fields(
|
|
301
|
+
"test__Obj__c", metadata_tree.fromstring(object_source_positive)
|
|
302
|
+
)
|
|
303
|
+
assert task._should_process_object_fields("test__Obj__c", None)
|
|
304
|
+
assert task._should_process_object_fields(
|
|
305
|
+
"Account", metadata_tree.fromstring(object_source_positive)
|
|
306
|
+
)
|
|
307
|
+
assert task._should_process_object_fields(
|
|
308
|
+
"test__Obj__e", metadata_tree.fromstring(object_source_positive)
|
|
309
|
+
)
|
|
310
|
+
assert not task._should_process_object_fields(
|
|
311
|
+
"test__Obj__c", metadata_tree.fromstring(object_source_negative)
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
def test_process_field_element__new(self):
|
|
315
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
316
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
317
|
+
<fullName>Lookup__c</fullName>
|
|
318
|
+
<label>Test</label>
|
|
319
|
+
<type>Lookup</type>
|
|
320
|
+
<referenceTo>Test__c</referenceTo>
|
|
321
|
+
</CustomField>
|
|
322
|
+
"""
|
|
323
|
+
task = create_task(GenerateDataDictionary, {})
|
|
324
|
+
p = Package(
|
|
325
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
326
|
+
)
|
|
327
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
328
|
+
|
|
329
|
+
task._init_schema()
|
|
330
|
+
task._process_field_element(
|
|
331
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
assert "test__Test__c.test__Lookup__c" in task.fields
|
|
335
|
+
|
|
336
|
+
assert task.fields["test__Test__c.test__Lookup__c"] == [
|
|
337
|
+
FieldDetail(
|
|
338
|
+
version=v,
|
|
339
|
+
sobject="test__Test__c",
|
|
340
|
+
api_name="test__Lookup__c",
|
|
341
|
+
label="Test",
|
|
342
|
+
type="Lookup to test__Test__c",
|
|
343
|
+
description="",
|
|
344
|
+
help_text="",
|
|
345
|
+
valid_values="",
|
|
346
|
+
)
|
|
347
|
+
]
|
|
348
|
+
|
|
349
|
+
def test_process_field_element__master_detail(self):
|
|
350
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
351
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
352
|
+
<fullName>Lookup__c</fullName>
|
|
353
|
+
<label>Test</label>
|
|
354
|
+
<type>MasterDetail</type>
|
|
355
|
+
<referenceTo>Test__c</referenceTo>
|
|
356
|
+
</CustomField>
|
|
357
|
+
"""
|
|
358
|
+
task = create_task(GenerateDataDictionary, {})
|
|
359
|
+
p = Package(
|
|
360
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
361
|
+
)
|
|
362
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
363
|
+
|
|
364
|
+
task._init_schema()
|
|
365
|
+
task._process_field_element(
|
|
366
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
assert "test__Test__c.test__Lookup__c" in task.fields
|
|
370
|
+
assert task.fields["test__Test__c.test__Lookup__c"] == [
|
|
371
|
+
FieldDetail(
|
|
372
|
+
version=v,
|
|
373
|
+
sobject="test__Test__c",
|
|
374
|
+
api_name="test__Lookup__c",
|
|
375
|
+
label="Test",
|
|
376
|
+
type="Master-Detail Relationship to test__Test__c",
|
|
377
|
+
description="",
|
|
378
|
+
help_text="",
|
|
379
|
+
valid_values="",
|
|
380
|
+
)
|
|
381
|
+
]
|
|
382
|
+
|
|
383
|
+
def test_process_field_element__blank_elements(self):
|
|
384
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
385
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
386
|
+
<fullName>Lookup__c</fullName>
|
|
387
|
+
<label>Test</label>
|
|
388
|
+
<description></description>
|
|
389
|
+
<inlineHelpText></inlineHelpText>
|
|
390
|
+
<type>MasterDetail</type>
|
|
391
|
+
<referenceTo>Test__c</referenceTo>
|
|
392
|
+
</CustomField>
|
|
393
|
+
"""
|
|
394
|
+
task = create_task(GenerateDataDictionary, {})
|
|
395
|
+
p = Package(
|
|
396
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
397
|
+
)
|
|
398
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
399
|
+
|
|
400
|
+
task._init_schema()
|
|
401
|
+
task._process_field_element(
|
|
402
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
assert "test__Test__c.test__Lookup__c" in task.fields
|
|
406
|
+
assert task.fields["test__Test__c.test__Lookup__c"] == [
|
|
407
|
+
FieldDetail(
|
|
408
|
+
version=v,
|
|
409
|
+
sobject="test__Test__c",
|
|
410
|
+
api_name="test__Lookup__c",
|
|
411
|
+
label="Test",
|
|
412
|
+
type="Master-Detail Relationship to test__Test__c",
|
|
413
|
+
description="",
|
|
414
|
+
help_text="",
|
|
415
|
+
valid_values="",
|
|
416
|
+
)
|
|
417
|
+
]
|
|
418
|
+
|
|
419
|
+
def test_process_field_element__standard(self):
|
|
420
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
421
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
422
|
+
<fullName>Account</fullName>
|
|
423
|
+
<label>Account</label>
|
|
424
|
+
<type>Lookup</type>
|
|
425
|
+
<referenceTo>Account</referenceTo>
|
|
426
|
+
</CustomField>
|
|
427
|
+
"""
|
|
428
|
+
task = create_task(GenerateDataDictionary, {})
|
|
429
|
+
|
|
430
|
+
task._init_schema()
|
|
431
|
+
p = Package(
|
|
432
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
433
|
+
)
|
|
434
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
435
|
+
|
|
436
|
+
task._process_field_element(
|
|
437
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
assert len(task.fields) == 0
|
|
441
|
+
|
|
442
|
+
def test_process_field_element__updated(self):
|
|
443
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
444
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
445
|
+
<fullName>Account__c</fullName>
|
|
446
|
+
<inlineHelpText>{}</inlineHelpText>
|
|
447
|
+
<label>Account</label>
|
|
448
|
+
<type>Lookup</type>
|
|
449
|
+
<referenceTo>Account</referenceTo>
|
|
450
|
+
</CustomField>
|
|
451
|
+
"""
|
|
452
|
+
task = create_task(GenerateDataDictionary, {})
|
|
453
|
+
|
|
454
|
+
task._init_schema()
|
|
455
|
+
p = Package(
|
|
456
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
457
|
+
)
|
|
458
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
459
|
+
v2 = PackageVersion(package=p, version=LooseVersion("1.2"))
|
|
460
|
+
|
|
461
|
+
task._process_field_element(
|
|
462
|
+
"test__Test__c",
|
|
463
|
+
metadata_tree.fromstring(xml_source.format("Initial").encode("utf-8")),
|
|
464
|
+
v,
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
assert task.fields["test__Test__c.test__Account__c"] == [
|
|
468
|
+
FieldDetail(
|
|
469
|
+
version=v,
|
|
470
|
+
sobject="test__Test__c",
|
|
471
|
+
api_name="test__Account__c",
|
|
472
|
+
label="Account",
|
|
473
|
+
type="Lookup to Account",
|
|
474
|
+
help_text="Initial",
|
|
475
|
+
description="",
|
|
476
|
+
valid_values="",
|
|
477
|
+
)
|
|
478
|
+
]
|
|
479
|
+
|
|
480
|
+
task._process_field_element(
|
|
481
|
+
"test__Test__c",
|
|
482
|
+
metadata_tree.fromstring(xml_source.format("New").encode("utf-8")),
|
|
483
|
+
v2,
|
|
484
|
+
)
|
|
485
|
+
assert task.fields["test__Test__c.test__Account__c"] == [
|
|
486
|
+
FieldDetail(
|
|
487
|
+
version=v,
|
|
488
|
+
sobject="test__Test__c",
|
|
489
|
+
api_name="test__Account__c",
|
|
490
|
+
label="Account",
|
|
491
|
+
type="Lookup to Account",
|
|
492
|
+
help_text="Initial",
|
|
493
|
+
description="",
|
|
494
|
+
valid_values="",
|
|
495
|
+
),
|
|
496
|
+
FieldDetail(
|
|
497
|
+
version=v2,
|
|
498
|
+
sobject="test__Test__c",
|
|
499
|
+
api_name="test__Account__c",
|
|
500
|
+
label="Account",
|
|
501
|
+
type="Lookup to Account",
|
|
502
|
+
help_text="New",
|
|
503
|
+
description="",
|
|
504
|
+
valid_values="",
|
|
505
|
+
),
|
|
506
|
+
]
|
|
507
|
+
|
|
508
|
+
def test_process_field_element__valid_values(self):
|
|
509
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
510
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
511
|
+
<fullName>Type__c</fullName>
|
|
512
|
+
<label>Type</label>
|
|
513
|
+
<type>Picklist</type>
|
|
514
|
+
<valueSet>
|
|
515
|
+
<valueSetDefinition>
|
|
516
|
+
<value>
|
|
517
|
+
<label>Test 1</label>
|
|
518
|
+
<fullName>Test 1 API</fullName>
|
|
519
|
+
</value>
|
|
520
|
+
<value>
|
|
521
|
+
<label>Test 2</label>
|
|
522
|
+
<fullName>Test 2 API</fullName>
|
|
523
|
+
</value>
|
|
524
|
+
</valueSetDefinition>
|
|
525
|
+
</valueSet>
|
|
526
|
+
</CustomField>
|
|
527
|
+
"""
|
|
528
|
+
task = create_task(GenerateDataDictionary, {})
|
|
529
|
+
|
|
530
|
+
task._init_schema()
|
|
531
|
+
p = Package(
|
|
532
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
533
|
+
)
|
|
534
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
535
|
+
|
|
536
|
+
task._process_field_element(
|
|
537
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
538
|
+
)
|
|
539
|
+
|
|
540
|
+
assert task.fields["test__Test__c.test__Type__c"] == [
|
|
541
|
+
FieldDetail(
|
|
542
|
+
version=v,
|
|
543
|
+
sobject="test__Test__c",
|
|
544
|
+
api_name="test__Type__c",
|
|
545
|
+
label="Type",
|
|
546
|
+
type="Picklist",
|
|
547
|
+
help_text="",
|
|
548
|
+
description="",
|
|
549
|
+
valid_values="Test 1; Test 2",
|
|
550
|
+
)
|
|
551
|
+
]
|
|
552
|
+
|
|
553
|
+
def test_process_field_element__valid_values_old_format(self):
|
|
554
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
555
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
556
|
+
<fullName>Type__c</fullName>
|
|
557
|
+
<label>Type</label>
|
|
558
|
+
<type>Picklist</type>
|
|
559
|
+
<picklist>
|
|
560
|
+
<picklistValues>
|
|
561
|
+
<fullName>Test 1</fullName>
|
|
562
|
+
<default>false</default>
|
|
563
|
+
</picklistValues>
|
|
564
|
+
<picklistValues>
|
|
565
|
+
<fullName>Test 2</fullName>
|
|
566
|
+
<default>false</default>
|
|
567
|
+
</picklistValues>
|
|
568
|
+
</picklist>
|
|
569
|
+
</CustomField>
|
|
570
|
+
"""
|
|
571
|
+
task = create_task(GenerateDataDictionary, {})
|
|
572
|
+
|
|
573
|
+
task._init_schema()
|
|
574
|
+
p = Package(
|
|
575
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
576
|
+
)
|
|
577
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
578
|
+
|
|
579
|
+
task._process_field_element(
|
|
580
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
581
|
+
)
|
|
582
|
+
|
|
583
|
+
assert task.fields["test__Test__c.test__Type__c"] == [
|
|
584
|
+
FieldDetail(
|
|
585
|
+
version=v,
|
|
586
|
+
sobject="test__Test__c",
|
|
587
|
+
api_name="test__Type__c",
|
|
588
|
+
label="Type",
|
|
589
|
+
type="Picklist",
|
|
590
|
+
help_text="",
|
|
591
|
+
description="",
|
|
592
|
+
valid_values="Test 1; Test 2",
|
|
593
|
+
)
|
|
594
|
+
]
|
|
595
|
+
|
|
596
|
+
def test_process_field_element__valid_values_global_value_set(self):
|
|
597
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
598
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
599
|
+
<fullName>Type__c</fullName>
|
|
600
|
+
<label>Type</label>
|
|
601
|
+
<type>Picklist</type>
|
|
602
|
+
<valueSet>
|
|
603
|
+
<valueSetName>Test Value Set</valueSetName>
|
|
604
|
+
</valueSet>
|
|
605
|
+
</CustomField>
|
|
606
|
+
"""
|
|
607
|
+
task = create_task(GenerateDataDictionary, {})
|
|
608
|
+
|
|
609
|
+
task._init_schema()
|
|
610
|
+
p = Package(
|
|
611
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
612
|
+
)
|
|
613
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
614
|
+
|
|
615
|
+
task._process_field_element(
|
|
616
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
617
|
+
)
|
|
618
|
+
|
|
619
|
+
assert task.fields["test__Test__c.test__Type__c"] == [
|
|
620
|
+
FieldDetail(
|
|
621
|
+
version=v,
|
|
622
|
+
sobject="test__Test__c",
|
|
623
|
+
api_name="test__Type__c",
|
|
624
|
+
label="Type",
|
|
625
|
+
type="Picklist",
|
|
626
|
+
help_text="",
|
|
627
|
+
description="",
|
|
628
|
+
valid_values="Global Value Set Test Value Set",
|
|
629
|
+
)
|
|
630
|
+
]
|
|
631
|
+
|
|
632
|
+
def test_process_field_element__text_length(self):
|
|
633
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
634
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
635
|
+
<fullName>Type__c</fullName>
|
|
636
|
+
<label>Type</label>
|
|
637
|
+
<type>Text</type>
|
|
638
|
+
<length>128</length>
|
|
639
|
+
</CustomField>
|
|
640
|
+
"""
|
|
641
|
+
task = create_task(GenerateDataDictionary, {})
|
|
642
|
+
|
|
643
|
+
task._init_schema()
|
|
644
|
+
p = Package(
|
|
645
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
646
|
+
)
|
|
647
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
648
|
+
|
|
649
|
+
task._process_field_element(
|
|
650
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
651
|
+
)
|
|
652
|
+
|
|
653
|
+
assert task.fields["test__Test__c.test__Type__c"] == [
|
|
654
|
+
FieldDetail(
|
|
655
|
+
version=v,
|
|
656
|
+
sobject="test__Test__c",
|
|
657
|
+
api_name="test__Type__c",
|
|
658
|
+
label="Type",
|
|
659
|
+
type="Text (128)",
|
|
660
|
+
help_text="",
|
|
661
|
+
description="",
|
|
662
|
+
valid_values="",
|
|
663
|
+
)
|
|
664
|
+
]
|
|
665
|
+
|
|
666
|
+
def test_process_field_element__number_length(self):
|
|
667
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
668
|
+
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
669
|
+
<fullName>Type__c</fullName>
|
|
670
|
+
<label>Type</label>
|
|
671
|
+
<type>Number</type>
|
|
672
|
+
<precision>18</precision>
|
|
673
|
+
<scale>2</scale>
|
|
674
|
+
</CustomField>
|
|
675
|
+
"""
|
|
676
|
+
task = create_task(GenerateDataDictionary, {})
|
|
677
|
+
|
|
678
|
+
task._init_schema()
|
|
679
|
+
p = Package(
|
|
680
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
681
|
+
)
|
|
682
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
683
|
+
|
|
684
|
+
task._process_field_element(
|
|
685
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
assert task.fields["test__Test__c.test__Type__c"] == [
|
|
689
|
+
FieldDetail(
|
|
690
|
+
version=v,
|
|
691
|
+
sobject="test__Test__c",
|
|
692
|
+
api_name="test__Type__c",
|
|
693
|
+
label="Type",
|
|
694
|
+
type="Number (16.2)",
|
|
695
|
+
help_text="",
|
|
696
|
+
description="",
|
|
697
|
+
valid_values="",
|
|
698
|
+
)
|
|
699
|
+
]
|
|
700
|
+
|
|
701
|
+
def test_process_object_element(self):
|
|
702
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
703
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
704
|
+
<description>Description</description>
|
|
705
|
+
<label>Test Object</label>
|
|
706
|
+
<fields>
|
|
707
|
+
<fullName>Type__c</fullName>
|
|
708
|
+
<inlineHelpText>Type of field.</inlineHelpText>
|
|
709
|
+
<description>Desc</description>
|
|
710
|
+
<label>Type</label>
|
|
711
|
+
<type>Text</type>
|
|
712
|
+
<length>128</length>
|
|
713
|
+
</fields>
|
|
714
|
+
</CustomObject>"""
|
|
715
|
+
|
|
716
|
+
task = create_task(GenerateDataDictionary, {})
|
|
717
|
+
|
|
718
|
+
task._init_schema()
|
|
719
|
+
p = Package(
|
|
720
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
721
|
+
)
|
|
722
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
723
|
+
|
|
724
|
+
task._process_object_element(
|
|
725
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
726
|
+
)
|
|
727
|
+
|
|
728
|
+
assert task.sobjects == {
|
|
729
|
+
"test__Test__c": [
|
|
730
|
+
SObjectDetail(
|
|
731
|
+
version=v,
|
|
732
|
+
api_name="test__Test__c",
|
|
733
|
+
label="Test Object",
|
|
734
|
+
description="Description",
|
|
735
|
+
)
|
|
736
|
+
]
|
|
737
|
+
}
|
|
738
|
+
assert task.fields == {
|
|
739
|
+
"test__Test__c.test__Type__c": [
|
|
740
|
+
FieldDetail(
|
|
741
|
+
version=v,
|
|
742
|
+
sobject="test__Test__c",
|
|
743
|
+
api_name="test__Type__c",
|
|
744
|
+
label="Type",
|
|
745
|
+
type="Text (128)",
|
|
746
|
+
help_text="Type of field.",
|
|
747
|
+
description="Desc",
|
|
748
|
+
valid_values="",
|
|
749
|
+
)
|
|
750
|
+
]
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
def test_process_object_element__missing_description(self):
|
|
754
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
755
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
756
|
+
<label>Test Object</label>
|
|
757
|
+
<fields>
|
|
758
|
+
<fullName>Type__c</fullName>
|
|
759
|
+
<inlineHelpText>Type of field.</inlineHelpText>
|
|
760
|
+
<label>Type</label>
|
|
761
|
+
<type>Text</type>
|
|
762
|
+
<length>128</length>
|
|
763
|
+
</fields>
|
|
764
|
+
</CustomObject>"""
|
|
765
|
+
|
|
766
|
+
task = create_task(GenerateDataDictionary, {})
|
|
767
|
+
|
|
768
|
+
task._init_schema()
|
|
769
|
+
p = Package(
|
|
770
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
771
|
+
)
|
|
772
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
773
|
+
|
|
774
|
+
task._process_object_element(
|
|
775
|
+
"test__Test__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
assert task.sobjects == {
|
|
779
|
+
"test__Test__c": [
|
|
780
|
+
SObjectDetail(
|
|
781
|
+
version=v,
|
|
782
|
+
api_name="test__Test__c",
|
|
783
|
+
label="Test Object",
|
|
784
|
+
description="",
|
|
785
|
+
)
|
|
786
|
+
]
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
def test_process_object_element__standard(self):
|
|
790
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
791
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
792
|
+
<description>Description</description>
|
|
793
|
+
<label>Test</label>
|
|
794
|
+
</CustomObject>"""
|
|
795
|
+
|
|
796
|
+
task = create_task(GenerateDataDictionary, {})
|
|
797
|
+
|
|
798
|
+
task._init_schema()
|
|
799
|
+
p = Package(
|
|
800
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
801
|
+
)
|
|
802
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
803
|
+
|
|
804
|
+
task._process_object_element(
|
|
805
|
+
"Account", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
806
|
+
)
|
|
807
|
+
|
|
808
|
+
assert "Account" not in task.sobjects
|
|
809
|
+
|
|
810
|
+
def test_process_object_element__protected_custom_setting(self):
|
|
811
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
812
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
813
|
+
<customSettingsType>List</customSettingsType>
|
|
814
|
+
<description>Description</description>
|
|
815
|
+
<visibility>Protected</visibility>
|
|
816
|
+
<label>Test</label>
|
|
817
|
+
</CustomObject>"""
|
|
818
|
+
|
|
819
|
+
task = create_task(GenerateDataDictionary, {})
|
|
820
|
+
|
|
821
|
+
task._init_schema()
|
|
822
|
+
p = Package(
|
|
823
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
824
|
+
)
|
|
825
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
826
|
+
|
|
827
|
+
task._process_object_element(
|
|
828
|
+
"test__CS__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
829
|
+
)
|
|
830
|
+
|
|
831
|
+
assert "test__CS__c" not in task.sobjects
|
|
832
|
+
assert task.omit_sobjects == set(["test__CS__c"])
|
|
833
|
+
|
|
834
|
+
def test_process_object_element__protected_custom_setting_included(self):
|
|
835
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
836
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
837
|
+
<customSettingsType>List</customSettingsType>
|
|
838
|
+
<description>Description</description>
|
|
839
|
+
<visibility>Protected</visibility>
|
|
840
|
+
<label>Test</label>
|
|
841
|
+
</CustomObject>"""
|
|
842
|
+
|
|
843
|
+
task = create_task(GenerateDataDictionary, {"include_protected_schema": True})
|
|
844
|
+
|
|
845
|
+
task._init_schema()
|
|
846
|
+
p = Package(
|
|
847
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
848
|
+
)
|
|
849
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
850
|
+
|
|
851
|
+
task._process_object_element(
|
|
852
|
+
"test__CS__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
853
|
+
)
|
|
854
|
+
|
|
855
|
+
assert "test__CS__c" in task.sobjects
|
|
856
|
+
assert "test__CS__c" not in task.omit_sobjects
|
|
857
|
+
|
|
858
|
+
def test_process_object_element__protected_custom_setting_old(self):
|
|
859
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
860
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
861
|
+
<customSettingsType>List</customSettingsType>
|
|
862
|
+
<description>Description</description>
|
|
863
|
+
<customSettingsVisibility>Protected</customSettingsVisibility>
|
|
864
|
+
<label>Test</label>
|
|
865
|
+
</CustomObject>"""
|
|
866
|
+
|
|
867
|
+
task = create_task(GenerateDataDictionary, {})
|
|
868
|
+
|
|
869
|
+
task._init_schema()
|
|
870
|
+
p = Package(
|
|
871
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
872
|
+
)
|
|
873
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
874
|
+
|
|
875
|
+
task._process_object_element(
|
|
876
|
+
"test__CS__c", metadata_tree.fromstring(xml_source.encode("utf-8")), v
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
assert "test__CS__c" not in task.sobjects
|
|
880
|
+
assert task.omit_sobjects == set(["test__CS__c"])
|
|
881
|
+
|
|
882
|
+
def test_process_sfdx_release(self):
|
|
883
|
+
object_source = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|
884
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
885
|
+
<description>Description</description>
|
|
886
|
+
<label>Test</label>
|
|
887
|
+
</CustomObject>"""
|
|
888
|
+
field_source = b"""<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
889
|
+
<fullName>Type__c</fullName>
|
|
890
|
+
<label>Type</label>
|
|
891
|
+
<type>Text</type>
|
|
892
|
+
<length>128</length>
|
|
893
|
+
</CustomField>
|
|
894
|
+
"""
|
|
895
|
+
|
|
896
|
+
def zip_read(filename):
|
|
897
|
+
if filename.endswith(".object-meta.xml"):
|
|
898
|
+
return object_source
|
|
899
|
+
|
|
900
|
+
return field_source
|
|
901
|
+
|
|
902
|
+
task = create_task(GenerateDataDictionary, {})
|
|
903
|
+
|
|
904
|
+
p = Package(
|
|
905
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
906
|
+
)
|
|
907
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
908
|
+
|
|
909
|
+
zip_file = Mock()
|
|
910
|
+
zip_file.read.side_effect = zip_read
|
|
911
|
+
zip_file.namelist.return_value = [
|
|
912
|
+
"force-app/main/default/objects/Child__c/Child__c.object-meta.xml",
|
|
913
|
+
"force-app/main/default/objects/Child__c/fields/Lookup__c.field-meta.xml",
|
|
914
|
+
"force-app/main/default/objects/Parent__c/Parent__c.object-meta.xml",
|
|
915
|
+
".gitignore",
|
|
916
|
+
"test__c.object-meta.xml",
|
|
917
|
+
]
|
|
918
|
+
task._process_object_element = Mock()
|
|
919
|
+
task._process_field_element = Mock()
|
|
920
|
+
task._process_sfdx_release(zip_file, v)
|
|
921
|
+
|
|
922
|
+
zip_file.read.assert_has_calls(
|
|
923
|
+
[
|
|
924
|
+
call(
|
|
925
|
+
"force-app/main/default/objects/Child__c/Child__c.object-meta.xml"
|
|
926
|
+
),
|
|
927
|
+
call(
|
|
928
|
+
"force-app/main/default/objects/Child__c/Child__c.object-meta.xml"
|
|
929
|
+
),
|
|
930
|
+
call(
|
|
931
|
+
"force-app/main/default/objects/Child__c/fields/Lookup__c.field-meta.xml"
|
|
932
|
+
),
|
|
933
|
+
call(
|
|
934
|
+
"force-app/main/default/objects/Parent__c/Parent__c.object-meta.xml"
|
|
935
|
+
),
|
|
936
|
+
]
|
|
937
|
+
)
|
|
938
|
+
|
|
939
|
+
assert len(task._process_object_element.call_args_list) == 2
|
|
940
|
+
assert task._process_object_element.call_args_list[0][0][0] == "test__Child__c"
|
|
941
|
+
assert task._process_object_element.call_args_list[1][0][0] == "test__Parent__c"
|
|
942
|
+
|
|
943
|
+
assert len(task._process_field_element.call_args_list) == 1
|
|
944
|
+
assert task._process_object_element.call_args_list[0][0][0] == "test__Child__c"
|
|
945
|
+
|
|
946
|
+
def test_process_sfdx_release__skips_protected_custom_settings_fields(self):
|
|
947
|
+
object_source = b"""<?xml version="1.0" encoding="UTF-8"?>
|
|
948
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
949
|
+
<customSettingsType>Hierarchy</customSettingsType>
|
|
950
|
+
<description>Description</description>
|
|
951
|
+
<label>Test</label>
|
|
952
|
+
<visibility>Protected</visibility>
|
|
953
|
+
</CustomObject>"""
|
|
954
|
+
field_source = b"""<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
955
|
+
<fullName>Type__c</fullName>
|
|
956
|
+
<label>Type</label>
|
|
957
|
+
<type>Text</type>
|
|
958
|
+
<length>128</length>
|
|
959
|
+
</CustomField>
|
|
960
|
+
"""
|
|
961
|
+
|
|
962
|
+
def zip_read(filename):
|
|
963
|
+
if filename.endswith(".object-meta.xml"):
|
|
964
|
+
return object_source
|
|
965
|
+
|
|
966
|
+
return field_source
|
|
967
|
+
|
|
968
|
+
task = create_task(GenerateDataDictionary, {})
|
|
969
|
+
task._init_schema()
|
|
970
|
+
|
|
971
|
+
p = Package(
|
|
972
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
973
|
+
)
|
|
974
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
975
|
+
|
|
976
|
+
zip_file = Mock()
|
|
977
|
+
zip_file.read.side_effect = zip_read
|
|
978
|
+
zip_file.namelist.return_value = [
|
|
979
|
+
"force-app/main/default/objects/Child__c/Child__c.object-meta.xml",
|
|
980
|
+
"force-app/main/default/objects/Child__c/fields/Lookup__c.field-meta.xml",
|
|
981
|
+
"force-app/main/default/objects/Parent__c/Parent__c.object-meta.xml",
|
|
982
|
+
".gitignore",
|
|
983
|
+
"test__c.object-meta.xml",
|
|
984
|
+
"sfdx-project.json",
|
|
985
|
+
]
|
|
986
|
+
task._process_object_element = Mock()
|
|
987
|
+
task._process_field_element = Mock()
|
|
988
|
+
task._process_sfdx_release(zip_file, v)
|
|
989
|
+
|
|
990
|
+
task._process_field_element.assert_not_called()
|
|
991
|
+
|
|
992
|
+
zip_file.read.assert_has_calls(
|
|
993
|
+
[
|
|
994
|
+
call(
|
|
995
|
+
"force-app/main/default/objects/Child__c/Child__c.object-meta.xml"
|
|
996
|
+
),
|
|
997
|
+
call(
|
|
998
|
+
"force-app/main/default/objects/Child__c/Child__c.object-meta.xml"
|
|
999
|
+
),
|
|
1000
|
+
call(
|
|
1001
|
+
"force-app/main/default/objects/Parent__c/Parent__c.object-meta.xml"
|
|
1002
|
+
),
|
|
1003
|
+
]
|
|
1004
|
+
)
|
|
1005
|
+
assert task.omit_sobjects == set(["test__Child__c", "test__Parent__c"])
|
|
1006
|
+
|
|
1007
|
+
def test_process_sfdx_release__handles_object_not_found(self):
|
|
1008
|
+
field_source = b"""<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
1009
|
+
<fullName>Type__c</fullName>
|
|
1010
|
+
<label>Type</label>
|
|
1011
|
+
<type>Text</type>
|
|
1012
|
+
<length>128</length>
|
|
1013
|
+
</CustomField>
|
|
1014
|
+
"""
|
|
1015
|
+
|
|
1016
|
+
def zip_read(filename):
|
|
1017
|
+
return field_source
|
|
1018
|
+
|
|
1019
|
+
task = create_task(GenerateDataDictionary, {})
|
|
1020
|
+
task._init_schema()
|
|
1021
|
+
|
|
1022
|
+
p = Package(
|
|
1023
|
+
repo=None, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
1024
|
+
)
|
|
1025
|
+
v = PackageVersion(package=p, version=LooseVersion("1.1"))
|
|
1026
|
+
|
|
1027
|
+
zip_file = Mock()
|
|
1028
|
+
zip_file.read.side_effect = zip_read
|
|
1029
|
+
zip_file.namelist.return_value = [
|
|
1030
|
+
"force-app/main/default/objects/Child__c/fields/Lookup__c.field-meta.xml",
|
|
1031
|
+
"sfdx-project.json",
|
|
1032
|
+
]
|
|
1033
|
+
task._process_object_element = Mock()
|
|
1034
|
+
task._process_field_element = Mock()
|
|
1035
|
+
task._should_process_object_fields = Mock(return_value=True)
|
|
1036
|
+
|
|
1037
|
+
task._process_sfdx_release(zip_file, v)
|
|
1038
|
+
|
|
1039
|
+
task._should_process_object_fields.assert_called_once_with(
|
|
1040
|
+
"test__Child__c", None
|
|
1041
|
+
)
|
|
1042
|
+
|
|
1043
|
+
@patch("cumulusci.tasks.datadictionary.download_extract_vcs_from_repo")
|
|
1044
|
+
def test_walk_releases__mdapi(self, extract_github):
|
|
1045
|
+
project_config = create_project_config()
|
|
1046
|
+
project_config.project__git__prefix_release = "rel/"
|
|
1047
|
+
project_config.project__name = "Project"
|
|
1048
|
+
task = create_task(GenerateDataDictionary, {}, project_config=project_config)
|
|
1049
|
+
task._init_schema()
|
|
1050
|
+
|
|
1051
|
+
repo = Mock()
|
|
1052
|
+
release = Mock()
|
|
1053
|
+
release.draft = False
|
|
1054
|
+
release.prerelease = False
|
|
1055
|
+
release.tag_name = "rel/1.1"
|
|
1056
|
+
repo.releases.return_value = [release]
|
|
1057
|
+
task._process_mdapi_release = Mock()
|
|
1058
|
+
extract_github.return_value.namelist.return_value = ["src/objects/"]
|
|
1059
|
+
p = Package(
|
|
1060
|
+
repo=repo, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
1061
|
+
)
|
|
1062
|
+
|
|
1063
|
+
task._walk_releases(p)
|
|
1064
|
+
|
|
1065
|
+
task._process_mdapi_release.assert_called_once_with(
|
|
1066
|
+
extract_github.return_value,
|
|
1067
|
+
PackageVersion(package=p, version=LooseVersion("1.1")),
|
|
1068
|
+
)
|
|
1069
|
+
|
|
1070
|
+
@patch("cumulusci.tasks.datadictionary.download_extract_vcs_from_repo")
|
|
1071
|
+
def test_walk_releases__sfdx(self, extract_github):
|
|
1072
|
+
project_config = create_project_config()
|
|
1073
|
+
project_config.project__git__prefix_release = "rel/"
|
|
1074
|
+
project_config.project__name = "Project"
|
|
1075
|
+
|
|
1076
|
+
task = create_task(GenerateDataDictionary, {}, project_config=project_config)
|
|
1077
|
+
task._init_schema()
|
|
1078
|
+
|
|
1079
|
+
repo = Mock()
|
|
1080
|
+
release = Mock()
|
|
1081
|
+
release.draft = False
|
|
1082
|
+
release.prerelease = False
|
|
1083
|
+
release.tag_name = "rel/1.1"
|
|
1084
|
+
repo.releases.return_value = [release]
|
|
1085
|
+
task._process_sfdx_release = Mock()
|
|
1086
|
+
extract_github.return_value.namelist.return_value = [
|
|
1087
|
+
"force-app/main/default/objects/",
|
|
1088
|
+
"sfdx-project.json",
|
|
1089
|
+
]
|
|
1090
|
+
p = Package(
|
|
1091
|
+
repo=repo, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
1092
|
+
)
|
|
1093
|
+
|
|
1094
|
+
task._walk_releases(p)
|
|
1095
|
+
|
|
1096
|
+
task._process_sfdx_release.assert_called_once_with(
|
|
1097
|
+
extract_github.return_value,
|
|
1098
|
+
PackageVersion(package=p, version=LooseVersion("1.1")),
|
|
1099
|
+
)
|
|
1100
|
+
|
|
1101
|
+
@patch("cumulusci.tasks.datadictionary.download_extract_vcs_from_repo")
|
|
1102
|
+
def test_walk_releases__draft(self, extract_github):
|
|
1103
|
+
project_config = create_project_config()
|
|
1104
|
+
project_config.project__git__prefix_release = "rel/"
|
|
1105
|
+
project_config.project__name = "Project"
|
|
1106
|
+
task = create_task(GenerateDataDictionary, {}, project_config=project_config)
|
|
1107
|
+
task._init_schema()
|
|
1108
|
+
|
|
1109
|
+
repo = Mock()
|
|
1110
|
+
release_draft = Mock()
|
|
1111
|
+
release_draft.draft = False
|
|
1112
|
+
release_draft.prerelease = False
|
|
1113
|
+
release_draft.tag_name = "uat/1.1_Beta_1"
|
|
1114
|
+
release_real = Mock()
|
|
1115
|
+
release_real.draft = False
|
|
1116
|
+
release_real.prerelease = False
|
|
1117
|
+
release_real.tag_name = "rel/1.1"
|
|
1118
|
+
|
|
1119
|
+
repo.releases.return_value = [release_draft, release_real]
|
|
1120
|
+
task._process_zipfile = Mock()
|
|
1121
|
+
p = Package(
|
|
1122
|
+
repo=repo, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
task._walk_releases(p)
|
|
1126
|
+
|
|
1127
|
+
task._process_zipfile.assert_called_once()
|
|
1128
|
+
|
|
1129
|
+
@patch("cumulusci.tasks.datadictionary.download_extract_vcs_from_repo")
|
|
1130
|
+
def test_walk_releases__prerelease(self, extract_github):
|
|
1131
|
+
project_config = create_project_config()
|
|
1132
|
+
project_config.project__git__prefix_release = "rel/"
|
|
1133
|
+
project_config.project__name = "Project"
|
|
1134
|
+
project_config.repo_info["branch"] = "feature/foo"
|
|
1135
|
+
task = create_task(
|
|
1136
|
+
GenerateDataDictionary,
|
|
1137
|
+
{"include_prerelease": True},
|
|
1138
|
+
project_config=project_config,
|
|
1139
|
+
)
|
|
1140
|
+
task._init_schema()
|
|
1141
|
+
|
|
1142
|
+
repo = Mock()
|
|
1143
|
+
release = Mock()
|
|
1144
|
+
release.draft = False
|
|
1145
|
+
release.prerelease = False
|
|
1146
|
+
release.tag_name = "rel/1.1"
|
|
1147
|
+
repo.releases.return_value = [release]
|
|
1148
|
+
task._process_mdapi_release = Mock()
|
|
1149
|
+
extract_github.return_value.namelist.return_value = ["src/objects/"]
|
|
1150
|
+
p = Package(
|
|
1151
|
+
repo=repo, package_name="Test", namespace="test__", prefix_release="rel/"
|
|
1152
|
+
)
|
|
1153
|
+
|
|
1154
|
+
task._walk_releases(p)
|
|
1155
|
+
|
|
1156
|
+
extract_github.assert_has_calls(
|
|
1157
|
+
[call(repo, ref="rel/1.1"), call(repo, ref="feature/foo")], any_order=True
|
|
1158
|
+
)
|
|
1159
|
+
task._process_mdapi_release.assert_has_calls(
|
|
1160
|
+
[
|
|
1161
|
+
call(
|
|
1162
|
+
extract_github.return_value,
|
|
1163
|
+
PackageVersion(package=p, version=LooseVersion("1.1")),
|
|
1164
|
+
),
|
|
1165
|
+
call(
|
|
1166
|
+
extract_github.return_value,
|
|
1167
|
+
PackageVersion(package=p, version=PRERELEASE_SIGIL),
|
|
1168
|
+
),
|
|
1169
|
+
]
|
|
1170
|
+
)
|
|
1171
|
+
|
|
1172
|
+
def test_init_schema(self):
|
|
1173
|
+
task = create_task(GenerateDataDictionary, {})
|
|
1174
|
+
task._init_schema()
|
|
1175
|
+
|
|
1176
|
+
assert task.fields is not None
|
|
1177
|
+
assert task.sobjects is not None
|
|
1178
|
+
|
|
1179
|
+
def test_run_task__additional_dependencies(self):
|
|
1180
|
+
project_config = create_project_config()
|
|
1181
|
+
project_config.keychain.get_service = Mock()
|
|
1182
|
+
project_config.project__package__name = "Project"
|
|
1183
|
+
project_config.project__name = "Project"
|
|
1184
|
+
project_config.project__package__namespace = "test"
|
|
1185
|
+
project_config.project__dependencies = [
|
|
1186
|
+
{"github": "https://github.com/test/test"}
|
|
1187
|
+
]
|
|
1188
|
+
|
|
1189
|
+
task = create_task(
|
|
1190
|
+
GenerateDataDictionary,
|
|
1191
|
+
{"additional_dependencies": [{"github": "https://github.com/test/test"}]},
|
|
1192
|
+
project_config=project_config,
|
|
1193
|
+
)
|
|
1194
|
+
task.get_repo = Mock()
|
|
1195
|
+
release = Mock()
|
|
1196
|
+
release.draft = False
|
|
1197
|
+
release.prerelease = False
|
|
1198
|
+
release.tag_name = "release/1.1"
|
|
1199
|
+
task.get_repo.return_value.releases.return_value = [release]
|
|
1200
|
+
task._get_repo_dependencies = Mock(return_value=[1, 2])
|
|
1201
|
+
task._walk_releases = Mock()
|
|
1202
|
+
|
|
1203
|
+
with temporary_dir():
|
|
1204
|
+
task._run_task()
|
|
1205
|
+
|
|
1206
|
+
task._get_repo_dependencies.assert_has_calls(
|
|
1207
|
+
[
|
|
1208
|
+
call(
|
|
1209
|
+
[
|
|
1210
|
+
GitHubDynamicDependency(github="https://github.com/test/test"),
|
|
1211
|
+
GitHubDynamicDependency(github="https://github.com/test/test"),
|
|
1212
|
+
]
|
|
1213
|
+
),
|
|
1214
|
+
]
|
|
1215
|
+
)
|
|
1216
|
+
|
|
1217
|
+
task._walk_releases.assert_has_calls(
|
|
1218
|
+
[
|
|
1219
|
+
call(
|
|
1220
|
+
Package(
|
|
1221
|
+
repo=task.get_repo.return_value,
|
|
1222
|
+
package_name=project_config.project__package__name,
|
|
1223
|
+
namespace="test__",
|
|
1224
|
+
prefix_release="release/",
|
|
1225
|
+
)
|
|
1226
|
+
),
|
|
1227
|
+
call(1),
|
|
1228
|
+
call(2),
|
|
1229
|
+
]
|
|
1230
|
+
)
|
|
1231
|
+
|
|
1232
|
+
@patch("cumulusci.tasks.datadictionary.download_extract_vcs_from_repo")
|
|
1233
|
+
def test_run_task(self, extract_github):
|
|
1234
|
+
# This is an integration test. We mock out `get_repo()` and the filesystem.
|
|
1235
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
1236
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
1237
|
+
<description>Description</description>
|
|
1238
|
+
<label>Test</label>
|
|
1239
|
+
<fields>
|
|
1240
|
+
<fullName>Type__c</fullName>
|
|
1241
|
+
<inlineHelpText>Type of field.</inlineHelpText>
|
|
1242
|
+
<label>Type</label>
|
|
1243
|
+
<type>Text</type>
|
|
1244
|
+
<length>255</length>
|
|
1245
|
+
</fields>
|
|
1246
|
+
</CustomObject>"""
|
|
1247
|
+
project_config = create_project_config()
|
|
1248
|
+
project_config.keychain.get_service = Mock()
|
|
1249
|
+
project_config.project__package__name = "Project"
|
|
1250
|
+
project_config.project__name = "Project"
|
|
1251
|
+
project_config.project__package__namespace = "test"
|
|
1252
|
+
|
|
1253
|
+
task = create_task(GenerateDataDictionary, project_config=project_config)
|
|
1254
|
+
|
|
1255
|
+
task.get_repo = Mock()
|
|
1256
|
+
release = Mock()
|
|
1257
|
+
release.draft = False
|
|
1258
|
+
release.prerelease = False
|
|
1259
|
+
release.tag_name = "release/1.1"
|
|
1260
|
+
task.get_repo.return_value.releases.return_value = [release]
|
|
1261
|
+
|
|
1262
|
+
extract_github.return_value.namelist.return_value = [
|
|
1263
|
+
"src/objects/",
|
|
1264
|
+
"src/objects/Test__c.object",
|
|
1265
|
+
]
|
|
1266
|
+
extract_github.return_value.read.return_value = xml_source.encode("utf-8")
|
|
1267
|
+
m = mock_open()
|
|
1268
|
+
|
|
1269
|
+
with patch("builtins.open", m):
|
|
1270
|
+
task()
|
|
1271
|
+
|
|
1272
|
+
m.assert_has_calls(
|
|
1273
|
+
[call("Project Objects.csv", "w"), call("Project Fields.csv", "w")],
|
|
1274
|
+
any_order=True,
|
|
1275
|
+
)
|
|
1276
|
+
|
|
1277
|
+
m.return_value.write.assert_has_calls(
|
|
1278
|
+
[
|
|
1279
|
+
call(
|
|
1280
|
+
'"Object Label","Object API Name","Object Description","Version Introduced","Version Deleted"\r\n'
|
|
1281
|
+
),
|
|
1282
|
+
call('"Test","test__Test__c","Description","Project 1.1",""\r\n'),
|
|
1283
|
+
call(
|
|
1284
|
+
'"Object Label","Object API Name","Field Label","Field API Name","Type","Picklist Values","Help Text","Field Description","Version Introduced","Version Picklist Values Last Changed","Version Help Text Last Changed","Version Deleted"\r\n'
|
|
1285
|
+
),
|
|
1286
|
+
call(
|
|
1287
|
+
'"Test","test__Test__c","Type","test__Type__c","Text (255)","","Type of field.","","Project 1.1","","",""\r\n'
|
|
1288
|
+
),
|
|
1289
|
+
],
|
|
1290
|
+
any_order=True,
|
|
1291
|
+
)
|
|
1292
|
+
|
|
1293
|
+
@patch("cumulusci.tasks.datadictionary.download_extract_vcs_from_repo")
|
|
1294
|
+
def test_run_task__prerelease(self, extract_github):
|
|
1295
|
+
# This is an integration test. We mock out `get_repo()` and the filesystem.
|
|
1296
|
+
xml_source = """<?xml version="1.0" encoding="UTF-8"?>
|
|
1297
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
1298
|
+
<description>Description</description>
|
|
1299
|
+
<label>Test</label>
|
|
1300
|
+
<fields>
|
|
1301
|
+
<fullName>Type__c</fullName>
|
|
1302
|
+
<inlineHelpText>Type of field.</inlineHelpText>
|
|
1303
|
+
<label>Type</label>
|
|
1304
|
+
<type>Text</type>
|
|
1305
|
+
<length>255</length>
|
|
1306
|
+
</fields>
|
|
1307
|
+
</CustomObject>"""
|
|
1308
|
+
xml_source_prerelease = """<?xml version="1.0" encoding="UTF-8"?>
|
|
1309
|
+
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
1310
|
+
<description>Description</description>
|
|
1311
|
+
<label>Test</label>
|
|
1312
|
+
<fields>
|
|
1313
|
+
<fullName>Type__c</fullName>
|
|
1314
|
+
<inlineHelpText>Type of field.</inlineHelpText>
|
|
1315
|
+
<label>Type</label>
|
|
1316
|
+
<type>Text</type>
|
|
1317
|
+
<length>255</length>
|
|
1318
|
+
</fields>
|
|
1319
|
+
<fields>
|
|
1320
|
+
<fullName>Description__c</fullName>
|
|
1321
|
+
<inlineHelpText>Description of field.</inlineHelpText>
|
|
1322
|
+
<label>Description</label>
|
|
1323
|
+
<type>Text</type>
|
|
1324
|
+
<length>255</length>
|
|
1325
|
+
</fields>
|
|
1326
|
+
</CustomObject>"""
|
|
1327
|
+
|
|
1328
|
+
project_config = create_project_config()
|
|
1329
|
+
project_config.keychain.get_service = Mock()
|
|
1330
|
+
project_config.project__package__name = "Project"
|
|
1331
|
+
project_config.project__name = "Project"
|
|
1332
|
+
project_config.project__package__namespace = "test"
|
|
1333
|
+
project_config.repo_info["branch"] = "testbranch"
|
|
1334
|
+
|
|
1335
|
+
task = create_task(
|
|
1336
|
+
GenerateDataDictionary,
|
|
1337
|
+
{"include_prerelease": True},
|
|
1338
|
+
project_config=project_config,
|
|
1339
|
+
)
|
|
1340
|
+
|
|
1341
|
+
task.get_repo = Mock()
|
|
1342
|
+
release = Mock()
|
|
1343
|
+
release.draft = False
|
|
1344
|
+
release.prerelease = False
|
|
1345
|
+
release.tag_name = "release/1.1"
|
|
1346
|
+
task.get_repo.return_value.releases.return_value = [release]
|
|
1347
|
+
|
|
1348
|
+
extract_github.return_value.namelist.return_value = [
|
|
1349
|
+
"src/objects/",
|
|
1350
|
+
"src/objects/Test__c.object",
|
|
1351
|
+
]
|
|
1352
|
+
extract_github.return_value.read.side_effect = [
|
|
1353
|
+
xml_source.encode("utf-8"),
|
|
1354
|
+
xml_source_prerelease.encode("utf-8"),
|
|
1355
|
+
]
|
|
1356
|
+
m = mock_open()
|
|
1357
|
+
|
|
1358
|
+
with patch("builtins.open", m):
|
|
1359
|
+
task()
|
|
1360
|
+
|
|
1361
|
+
m.assert_has_calls(
|
|
1362
|
+
[call("Project Objects.csv", "w"), call("Project Fields.csv", "w")],
|
|
1363
|
+
any_order=True,
|
|
1364
|
+
)
|
|
1365
|
+
|
|
1366
|
+
m.return_value.write.assert_has_calls(
|
|
1367
|
+
[
|
|
1368
|
+
call(
|
|
1369
|
+
'"Object Label","Object API Name","Object Description","Version Introduced","Version Deleted"\r\n'
|
|
1370
|
+
),
|
|
1371
|
+
call('"Test","test__Test__c","Description","Project 1.1",""\r\n'),
|
|
1372
|
+
call(
|
|
1373
|
+
'"Object Label","Object API Name","Field Label","Field API Name","Type","Picklist Values","Help Text","Field Description","Version Introduced","Version Picklist Values Last Changed","Version Help Text Last Changed","Version Deleted"\r\n'
|
|
1374
|
+
),
|
|
1375
|
+
call(
|
|
1376
|
+
'"Test","test__Test__c","Type","test__Type__c","Text (255)","","Type of field.","","Project 1.1","","",""\r\n'
|
|
1377
|
+
),
|
|
1378
|
+
call(
|
|
1379
|
+
'"Test","test__Test__c","Description","test__Description__c","Text (255)","","Description of field.","","Project Prerelease","","",""\r\n'
|
|
1380
|
+
),
|
|
1381
|
+
],
|
|
1382
|
+
any_order=True,
|
|
1383
|
+
)
|
|
1384
|
+
|
|
1385
|
+
def test_init_options(self):
|
|
1386
|
+
task = create_task(
|
|
1387
|
+
GenerateDataDictionary,
|
|
1388
|
+
{"object_path": "objects.csv", "field_path": "fields.csv"},
|
|
1389
|
+
)
|
|
1390
|
+
|
|
1391
|
+
assert task.options["object_path"] == "objects.csv"
|
|
1392
|
+
assert task.options["field_path"] == "fields.csv"
|
|
1393
|
+
|
|
1394
|
+
def test_init_options__defaults(self):
|
|
1395
|
+
project_config = create_project_config()
|
|
1396
|
+
project_config.project__name = "Project"
|
|
1397
|
+
|
|
1398
|
+
task = create_task(GenerateDataDictionary, {}, project_config)
|
|
1399
|
+
|
|
1400
|
+
assert task.options["object_path"] == "Project Objects.csv"
|
|
1401
|
+
assert task.options["field_path"] == "Project Fields.csv"
|
|
1402
|
+
|
|
1403
|
+
def test_init_options__bad_deps(self):
|
|
1404
|
+
project_config = create_project_config()
|
|
1405
|
+
project_config.project__name = "Project"
|
|
1406
|
+
|
|
1407
|
+
with pytest.raises(DependencyParseError):
|
|
1408
|
+
create_task(
|
|
1409
|
+
GenerateDataDictionary,
|
|
1410
|
+
{"additional_dependencies": [{"namespace": "foo"}]},
|
|
1411
|
+
project_config,
|
|
1412
|
+
)
|
|
1413
|
+
|
|
1414
|
+
def test_init_options__non_github_deps(self):
|
|
1415
|
+
project_config = create_project_config()
|
|
1416
|
+
project_config.project__name = "Project"
|
|
1417
|
+
|
|
1418
|
+
with pytest.raises(TaskOptionsError):
|
|
1419
|
+
create_task(
|
|
1420
|
+
GenerateDataDictionary,
|
|
1421
|
+
{"additional_dependencies": [{"namespace": "foo", "version": "1.0"}]},
|
|
1422
|
+
project_config,
|
|
1423
|
+
)
|
|
1424
|
+
|
|
1425
|
+
def test_init_options__prerelease(self):
|
|
1426
|
+
project_config = create_project_config()
|
|
1427
|
+
project_config.project__name = "Project"
|
|
1428
|
+
|
|
1429
|
+
with pytest.raises(TaskOptionsError):
|
|
1430
|
+
create_task(
|
|
1431
|
+
GenerateDataDictionary,
|
|
1432
|
+
{
|
|
1433
|
+
"include_prerelease": True,
|
|
1434
|
+
"additional_dependencies": [
|
|
1435
|
+
{"github": "http://github.com/test/test"}
|
|
1436
|
+
],
|
|
1437
|
+
},
|
|
1438
|
+
project_config,
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
task = create_task(
|
|
1442
|
+
GenerateDataDictionary,
|
|
1443
|
+
{"include_prerelease": True, "include_dependencies": True},
|
|
1444
|
+
project_config,
|
|
1445
|
+
)
|
|
1446
|
+
|
|
1447
|
+
assert task.options["include_dependencies"] is False
|
|
1448
|
+
|
|
1449
|
+
def test_get_repo_dependencies__none(self):
|
|
1450
|
+
task = create_task(
|
|
1451
|
+
GenerateDataDictionary,
|
|
1452
|
+
{
|
|
1453
|
+
"object_path": "object.csv",
|
|
1454
|
+
"field_path": "fields.csv",
|
|
1455
|
+
"release_prefix": "rel/",
|
|
1456
|
+
},
|
|
1457
|
+
)
|
|
1458
|
+
|
|
1459
|
+
assert task._get_repo_dependencies([]) == []
|
|
1460
|
+
|
|
1461
|
+
@patch("cumulusci.vcs.github.service.GitHubService")
|
|
1462
|
+
@patch("cumulusci.vcs.github.service.GitHubEnterpriseService")
|
|
1463
|
+
def test_get_repo_dependencies__cannot_get_repo(
|
|
1464
|
+
self, mock_github_service, mock_github_enterprise_service
|
|
1465
|
+
):
|
|
1466
|
+
mock_github_service.get_service_for_url.return_value = None
|
|
1467
|
+
mock_github_enterprise_service.get_service_for_url.return_value = None
|
|
1468
|
+
|
|
1469
|
+
project_config = create_project_config()
|
|
1470
|
+
project_config.project__git__prefix_release = "rel/"
|
|
1471
|
+
project_config.project__name = "Project"
|
|
1472
|
+
|
|
1473
|
+
task = create_task(
|
|
1474
|
+
GenerateDataDictionary,
|
|
1475
|
+
{
|
|
1476
|
+
"object_path": "object.csv",
|
|
1477
|
+
"field_path": "fields.csv",
|
|
1478
|
+
"release_prefix": "rel/",
|
|
1479
|
+
},
|
|
1480
|
+
project_config=project_config,
|
|
1481
|
+
)
|
|
1482
|
+
|
|
1483
|
+
project_config.project__dependencies = [
|
|
1484
|
+
{"github": "https://github.com/test/test"}
|
|
1485
|
+
]
|
|
1486
|
+
project_config.get_repo_from_url = Mock(return_value=None)
|
|
1487
|
+
|
|
1488
|
+
with pytest.raises(DependencyResolutionError):
|
|
1489
|
+
task._get_repo_dependencies(
|
|
1490
|
+
parse_dependencies(project_config.project__dependencies)
|
|
1491
|
+
)
|
|
1492
|
+
|
|
1493
|
+
@patch("cumulusci.tasks.datadictionary.get_static_dependencies")
|
|
1494
|
+
@patch("cumulusci.tasks.datadictionary.get_repo_from_url")
|
|
1495
|
+
@patch("cumulusci.tasks.datadictionary.get_remote_project_config")
|
|
1496
|
+
def test_get_repo_dependencies__success(
|
|
1497
|
+
self, get_remote_project_config, get_repo_from_url, get_static_dependencies
|
|
1498
|
+
):
|
|
1499
|
+
project_config = create_project_config()
|
|
1500
|
+
project_config.project__git__prefix_release = "rel/"
|
|
1501
|
+
project_config.project__name = "Project"
|
|
1502
|
+
|
|
1503
|
+
task = create_task(GenerateDataDictionary, {}, project_config=project_config)
|
|
1504
|
+
|
|
1505
|
+
project_config.project__dependencies = [
|
|
1506
|
+
{"github": "https://github.com/test/test"}
|
|
1507
|
+
]
|
|
1508
|
+
|
|
1509
|
+
cumulusci_yml_one = io.StringIO(
|
|
1510
|
+
"""
|
|
1511
|
+
project:
|
|
1512
|
+
name: Test 1
|
|
1513
|
+
package:
|
|
1514
|
+
name: Test 1
|
|
1515
|
+
namespace: test1
|
|
1516
|
+
dependencies:
|
|
1517
|
+
- github: "https://github.com/test1/test1"
|
|
1518
|
+
"""
|
|
1519
|
+
)
|
|
1520
|
+
cumulusci_yml_two = io.StringIO(
|
|
1521
|
+
"""
|
|
1522
|
+
project:
|
|
1523
|
+
name: Test 2
|
|
1524
|
+
package:
|
|
1525
|
+
name: Test 2
|
|
1526
|
+
dependencies:
|
|
1527
|
+
- github: "test1"
|
|
1528
|
+
git:
|
|
1529
|
+
prefix_release: "rel/"
|
|
1530
|
+
"""
|
|
1531
|
+
)
|
|
1532
|
+
|
|
1533
|
+
def fake_get_static_dependencies(
|
|
1534
|
+
context,
|
|
1535
|
+
dependencies=None,
|
|
1536
|
+
resolution_strategy=None,
|
|
1537
|
+
strategies=None,
|
|
1538
|
+
filter_function=None,
|
|
1539
|
+
):
|
|
1540
|
+
filter_function(
|
|
1541
|
+
GitHubDynamicDependency(github="https://github.com/test/test")
|
|
1542
|
+
),
|
|
1543
|
+
filter_function(
|
|
1544
|
+
GitHubDynamicDependency(github="https://github.com/test1/test1")
|
|
1545
|
+
)
|
|
1546
|
+
return [
|
|
1547
|
+
GitHubDynamicDependency(github="https://github.com/test/test"),
|
|
1548
|
+
GitHubDynamicDependency(github="https://github.com/test1/test1"),
|
|
1549
|
+
]
|
|
1550
|
+
|
|
1551
|
+
get_static_dependencies.side_effect = fake_get_static_dependencies
|
|
1552
|
+
|
|
1553
|
+
get_remote_project_config.side_effect = [
|
|
1554
|
+
BaseProjectConfig(None, cci_safe_load(cumulusci_yml_one)),
|
|
1555
|
+
BaseProjectConfig(None, cci_safe_load(cumulusci_yml_two)),
|
|
1556
|
+
]
|
|
1557
|
+
|
|
1558
|
+
results = task._get_repo_dependencies(
|
|
1559
|
+
parse_dependencies(project_config.project__dependencies)
|
|
1560
|
+
)
|
|
1561
|
+
|
|
1562
|
+
assert results == [
|
|
1563
|
+
Package(
|
|
1564
|
+
repo=get_repo_from_url.return_value,
|
|
1565
|
+
package_name="Test 1",
|
|
1566
|
+
namespace="test1__",
|
|
1567
|
+
prefix_release="release/",
|
|
1568
|
+
),
|
|
1569
|
+
Package(
|
|
1570
|
+
repo=get_repo_from_url.return_value,
|
|
1571
|
+
package_name="Test 2",
|
|
1572
|
+
namespace="",
|
|
1573
|
+
prefix_release="rel/",
|
|
1574
|
+
),
|
|
1575
|
+
]
|