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,860 @@
|
|
|
1
|
+
import csv
|
|
2
|
+
import os.path
|
|
3
|
+
import re
|
|
4
|
+
import shutil
|
|
5
|
+
import sys
|
|
6
|
+
import tempfile
|
|
7
|
+
from contextlib import contextmanager
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from unittest import mock
|
|
10
|
+
from xml.etree import ElementTree as ET
|
|
11
|
+
|
|
12
|
+
import pytest
|
|
13
|
+
import responses
|
|
14
|
+
from robot.libdocpkg.robotbuilder import LibraryDocBuilder
|
|
15
|
+
|
|
16
|
+
from cumulusci.core.config import BaseProjectConfig, TaskConfig, UniversalConfig
|
|
17
|
+
from cumulusci.core.exceptions import RobotTestFailure, TaskOptionsError
|
|
18
|
+
from cumulusci.core.tests.utils import MockLoggerMixin
|
|
19
|
+
from cumulusci.tasks.robotframework import Robot, RobotLibDoc, RobotTestDoc
|
|
20
|
+
from cumulusci.tasks.robotframework.debugger import DebugListener
|
|
21
|
+
from cumulusci.tasks.robotframework.libdoc import KeywordFile
|
|
22
|
+
from cumulusci.tasks.robotframework.robotframework import KeywordLogger
|
|
23
|
+
from cumulusci.tasks.salesforce.tests.util import create_task
|
|
24
|
+
from cumulusci.utils import temporary_dir, touch
|
|
25
|
+
from cumulusci.utils.xml.robot_xml import log_perf_summary_from_xml
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class TestRobot:
|
|
29
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
30
|
+
def test_run_task_with_failure(self, robot_run):
|
|
31
|
+
robot_run.return_value = 1
|
|
32
|
+
task = create_task(Robot, {"suites": "tests", "pdb": True})
|
|
33
|
+
with pytest.raises(RobotTestFailure):
|
|
34
|
+
task()
|
|
35
|
+
|
|
36
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
37
|
+
def test_run_task_error_message(self, robot_run):
|
|
38
|
+
expected = {
|
|
39
|
+
1: "1 test failed.", # singular; pet peeve of my to see "1 tests"
|
|
40
|
+
2: "2 tests failed.", # plural
|
|
41
|
+
249: "249 tests failed.",
|
|
42
|
+
250: "250 or more tests failed.",
|
|
43
|
+
251: "Help or version information printed.",
|
|
44
|
+
252: "Invalid test data or command line options.",
|
|
45
|
+
253: "Test execution stopped by user.",
|
|
46
|
+
255: "Unexpected internal error",
|
|
47
|
+
}
|
|
48
|
+
for error_code in expected.keys():
|
|
49
|
+
robot_run.return_value = error_code
|
|
50
|
+
task = create_task(Robot, {"suites": "tests", "pdb": True})
|
|
51
|
+
with pytest.raises(RobotTestFailure) as e:
|
|
52
|
+
task()
|
|
53
|
+
assert str(e.value) == expected[error_code]
|
|
54
|
+
|
|
55
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.patch_statusreporter")
|
|
56
|
+
def test_pdb_arg(self, patch_statusreporter):
|
|
57
|
+
create_task(
|
|
58
|
+
Robot,
|
|
59
|
+
{
|
|
60
|
+
"suites": "test", # required, or the task will raise an exception
|
|
61
|
+
"pdb": "False",
|
|
62
|
+
},
|
|
63
|
+
)
|
|
64
|
+
patch_statusreporter.assert_not_called()
|
|
65
|
+
|
|
66
|
+
create_task(
|
|
67
|
+
Robot,
|
|
68
|
+
{
|
|
69
|
+
"suites": "test", # required, or the task will raise an exception
|
|
70
|
+
"pdb": "True",
|
|
71
|
+
},
|
|
72
|
+
)
|
|
73
|
+
patch_statusreporter.assert_called_once()
|
|
74
|
+
|
|
75
|
+
def test_list_args(self):
|
|
76
|
+
"""Verify that certain arguments are converted to lists"""
|
|
77
|
+
task = create_task(
|
|
78
|
+
Robot,
|
|
79
|
+
{
|
|
80
|
+
"suites": "test", # required, or the task will raise an exception
|
|
81
|
+
"test": "one, two",
|
|
82
|
+
"include": "foo, bar",
|
|
83
|
+
"exclude": "a, b",
|
|
84
|
+
"vars": "uno, dos, tres",
|
|
85
|
+
"skip": "xyzzy,plugh",
|
|
86
|
+
},
|
|
87
|
+
)
|
|
88
|
+
for option in ("test", "include", "exclude", "vars", "suites", "skip"):
|
|
89
|
+
assert isinstance(task.options[option], list)
|
|
90
|
+
|
|
91
|
+
def test_options_converted_to_dict(self):
|
|
92
|
+
task = create_task(
|
|
93
|
+
Robot,
|
|
94
|
+
{
|
|
95
|
+
"suites": "test", # required, or the task will raise an exception
|
|
96
|
+
"options": "outputdir:/tmp/example,loglevel:DEBUG",
|
|
97
|
+
},
|
|
98
|
+
)
|
|
99
|
+
assert isinstance(task.options["options"], dict)
|
|
100
|
+
|
|
101
|
+
def test_process_arg_requires_int(self):
|
|
102
|
+
"""Verify we throw a useful error for non-int "processes" option"""
|
|
103
|
+
|
|
104
|
+
expected = "Please specify an integer for the `processes` option."
|
|
105
|
+
with pytest.raises(TaskOptionsError, match=expected):
|
|
106
|
+
create_task(Robot, {"suites": "tests", "processes": "bogus"})
|
|
107
|
+
|
|
108
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
109
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.subprocess.run")
|
|
110
|
+
def test_pabot_arg_with_process_eq_one(self, mock_subprocess_run, mock_robot_run):
|
|
111
|
+
"""Verify that pabot-specific arguments are ignored if processes==1"""
|
|
112
|
+
mock_robot_run.return_value = 0
|
|
113
|
+
task = create_task(
|
|
114
|
+
Robot,
|
|
115
|
+
{
|
|
116
|
+
"suites": "tests",
|
|
117
|
+
"process": 1,
|
|
118
|
+
"ordering": "robot/order.txt",
|
|
119
|
+
"testlevelsplit": "true",
|
|
120
|
+
},
|
|
121
|
+
)
|
|
122
|
+
task()
|
|
123
|
+
mock_subprocess_run.assert_not_called()
|
|
124
|
+
outputdir = str(Path(".").resolve())
|
|
125
|
+
mock_robot_run.assert_called_once_with(
|
|
126
|
+
"tests",
|
|
127
|
+
listener=[],
|
|
128
|
+
outputdir=outputdir,
|
|
129
|
+
variable=["org:test"],
|
|
130
|
+
tagstatexclude=["cci_metric_elapsed_time", "cci_metric"],
|
|
131
|
+
stdout=sys.stdout,
|
|
132
|
+
stderr=sys.stderr,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
136
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.subprocess.run")
|
|
137
|
+
def test_process_arg_eq_one(self, mock_subprocess_run, mock_robot_run):
|
|
138
|
+
"""Verify that setting the process option to 1 runs robot rather than pabot"""
|
|
139
|
+
mock_robot_run.return_value = 0
|
|
140
|
+
task = create_task(Robot, {"suites": "tests", "process": 1})
|
|
141
|
+
task()
|
|
142
|
+
mock_subprocess_run.assert_not_called()
|
|
143
|
+
outputdir = str(Path(".").resolve())
|
|
144
|
+
mock_robot_run.assert_called_once_with(
|
|
145
|
+
"tests",
|
|
146
|
+
listener=[],
|
|
147
|
+
outputdir=outputdir,
|
|
148
|
+
variable=["org:test"],
|
|
149
|
+
tagstatexclude=["cci_metric_elapsed_time", "cci_metric"],
|
|
150
|
+
stdout=sys.stdout,
|
|
151
|
+
stderr=sys.stderr,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
155
|
+
def test_suites(self, mock_robot_run):
|
|
156
|
+
"""Verify that passing a list of suites is handled properly"""
|
|
157
|
+
mock_robot_run.return_value = 0
|
|
158
|
+
task = create_task(Robot, {"suites": "tests,more_tests", "process": 1})
|
|
159
|
+
task()
|
|
160
|
+
outputdir = str(Path(".").resolve())
|
|
161
|
+
mock_robot_run.assert_called_once_with(
|
|
162
|
+
"tests",
|
|
163
|
+
"more_tests",
|
|
164
|
+
listener=[],
|
|
165
|
+
outputdir=outputdir,
|
|
166
|
+
variable=["org:test"],
|
|
167
|
+
tagstatexclude=["cci_metric_elapsed_time", "cci_metric"],
|
|
168
|
+
stdout=sys.stdout,
|
|
169
|
+
stderr=sys.stderr,
|
|
170
|
+
)
|
|
171
|
+
|
|
172
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
173
|
+
def test_tagstatexclude(self, mock_robot_run):
|
|
174
|
+
"""Verify tagstatexclude is treated as a list"""
|
|
175
|
+
mock_robot_run.return_value = 0
|
|
176
|
+
task = create_task(
|
|
177
|
+
Robot,
|
|
178
|
+
{
|
|
179
|
+
"suites": "test", # required, or the task will raise an exception
|
|
180
|
+
"options": {
|
|
181
|
+
"tagstatexclude": "this,that",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
)
|
|
185
|
+
assert type(task.options["options"]["tagstatexclude"]) is list
|
|
186
|
+
task()
|
|
187
|
+
outputdir = str(Path(".").resolve())
|
|
188
|
+
mock_robot_run.assert_called_once_with(
|
|
189
|
+
"test",
|
|
190
|
+
listener=[],
|
|
191
|
+
outputdir=outputdir,
|
|
192
|
+
variable=["org:test"],
|
|
193
|
+
tagstatexclude=["this", "that", "cci_metric_elapsed_time", "cci_metric"],
|
|
194
|
+
stdout=sys.stdout,
|
|
195
|
+
stderr=sys.stderr,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
def test_default_listeners(self):
|
|
199
|
+
# first, verify that not specifying any listener options
|
|
200
|
+
# results in no listeners...
|
|
201
|
+
task = create_task(
|
|
202
|
+
Robot, {"suites": "test"} # required, or the task will raise an exception
|
|
203
|
+
)
|
|
204
|
+
assert len(task.options["options"]["listener"]) == 0
|
|
205
|
+
|
|
206
|
+
# next, make sure that if we specify the options with a Falsy
|
|
207
|
+
# string, the option is properly treated like a boolean
|
|
208
|
+
task = create_task(
|
|
209
|
+
Robot,
|
|
210
|
+
{
|
|
211
|
+
"suites": "test", # required, or the task will raise an exception
|
|
212
|
+
"verbose": "False",
|
|
213
|
+
"robot_debug": "False",
|
|
214
|
+
},
|
|
215
|
+
)
|
|
216
|
+
assert len(task.options["options"]["listener"]) == 0
|
|
217
|
+
|
|
218
|
+
def test_debug_option(self):
|
|
219
|
+
"""Verify that setting debug to True attaches the appropriate listener"""
|
|
220
|
+
task = create_task(
|
|
221
|
+
Robot,
|
|
222
|
+
{
|
|
223
|
+
"suites": "test", # required, or the task will raise an exception
|
|
224
|
+
"robot_debug": "True",
|
|
225
|
+
},
|
|
226
|
+
)
|
|
227
|
+
listener_classes = [
|
|
228
|
+
listener.__class__ for listener in task.options["options"]["listener"]
|
|
229
|
+
]
|
|
230
|
+
assert (
|
|
231
|
+
DebugListener in listener_classes
|
|
232
|
+
), "DebugListener was not in task options"
|
|
233
|
+
|
|
234
|
+
def test_verbose_option(self):
|
|
235
|
+
"""Verify that setting verbose to True attaches the appropriate listener"""
|
|
236
|
+
task = create_task(
|
|
237
|
+
Robot,
|
|
238
|
+
{
|
|
239
|
+
"suites": "test", # required, or the task will raise an exception
|
|
240
|
+
"verbose": "True",
|
|
241
|
+
},
|
|
242
|
+
)
|
|
243
|
+
listener_classes = [
|
|
244
|
+
listener.__class__ for listener in task.options["options"]["listener"]
|
|
245
|
+
]
|
|
246
|
+
assert (
|
|
247
|
+
KeywordLogger in listener_classes
|
|
248
|
+
), "KeywordLogger was not in task options"
|
|
249
|
+
|
|
250
|
+
def test_user_defined_listeners_option(self):
|
|
251
|
+
"""Verify that our listeners don't replace user-defined listeners"""
|
|
252
|
+
task = create_task(
|
|
253
|
+
Robot,
|
|
254
|
+
{
|
|
255
|
+
"suites": "test", # required, or the task will raise an exception
|
|
256
|
+
"robot_debug": "True",
|
|
257
|
+
"verbose": "True",
|
|
258
|
+
"options": {"listener": ["FakeListener.py"]},
|
|
259
|
+
},
|
|
260
|
+
)
|
|
261
|
+
listener_classes = [
|
|
262
|
+
listener.__class__ for listener in task.options["options"]["listener"]
|
|
263
|
+
]
|
|
264
|
+
assert "FakeListener.py" in task.options["options"]["listener"]
|
|
265
|
+
assert DebugListener in listener_classes
|
|
266
|
+
assert KeywordLogger in listener_classes
|
|
267
|
+
|
|
268
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
269
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.add_path")
|
|
270
|
+
def test_sources(self, mock_add_path, mock_robot_run):
|
|
271
|
+
"""Verify that sources get added to PYTHONPATH when task runs"""
|
|
272
|
+
universal_config = UniversalConfig()
|
|
273
|
+
project_config = BaseProjectConfig(
|
|
274
|
+
universal_config,
|
|
275
|
+
{
|
|
276
|
+
"sources": {
|
|
277
|
+
"test1": {"path": "dummy1"},
|
|
278
|
+
"test2": {"path": "dummy2"},
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
)
|
|
282
|
+
# get_namespace returns a config. The only part of the config
|
|
283
|
+
# that the code uses is the repo_root property, so we don't need
|
|
284
|
+
# a full blown config.
|
|
285
|
+
project_config.get_namespace = mock.Mock(
|
|
286
|
+
side_effect=lambda source: mock.Mock(
|
|
287
|
+
repo_root=project_config.sources[source]["path"]
|
|
288
|
+
)
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
task = create_task(
|
|
292
|
+
Robot,
|
|
293
|
+
{"suites": "test", "sources": ["test1", "test2"]},
|
|
294
|
+
project_config=project_config,
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
mock_robot_run.return_value = 0
|
|
298
|
+
assert "dummy1" not in sys.path
|
|
299
|
+
assert "dummy2" not in sys.path
|
|
300
|
+
task()
|
|
301
|
+
project_config.get_namespace.assert_has_calls(
|
|
302
|
+
[mock.call("test1"), mock.call("test2")]
|
|
303
|
+
)
|
|
304
|
+
mock_add_path.assert_has_calls(
|
|
305
|
+
[mock.call("dummy1", end=True), mock.call("dummy2", end=True)]
|
|
306
|
+
)
|
|
307
|
+
assert "dummy1" not in sys.path
|
|
308
|
+
assert "dummy2" not in sys.path
|
|
309
|
+
assert (
|
|
310
|
+
Path(".").resolve() == Path(task.return_values["robot_outputdir"]).resolve()
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
314
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.add_path")
|
|
315
|
+
def test_repo_root_in_sys_path(self, mock_add_path, mock_robot_run):
|
|
316
|
+
"""Verify that the repo root is added to sys.path
|
|
317
|
+
|
|
318
|
+
Normally, the repo root is added to sys.path in the __init__
|
|
319
|
+
of BaseSalesforceTask. However, if we're running a task from
|
|
320
|
+
another repo, the git root of that other repo isn't added. The
|
|
321
|
+
robot task will do that; this verifies that.
|
|
322
|
+
|
|
323
|
+
"""
|
|
324
|
+
mock_robot_run.return_value = 0
|
|
325
|
+
universal_config = UniversalConfig()
|
|
326
|
+
project_config = BaseProjectConfig(universal_config)
|
|
327
|
+
with temporary_dir() as d:
|
|
328
|
+
project_config.repo_info["root"] = d
|
|
329
|
+
task = create_task(
|
|
330
|
+
Robot, {"suites": "tests"}, project_config=project_config
|
|
331
|
+
)
|
|
332
|
+
assert d not in sys.path
|
|
333
|
+
task()
|
|
334
|
+
mock_add_path.assert_called_once_with(d)
|
|
335
|
+
assert d not in sys.path
|
|
336
|
+
|
|
337
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
338
|
+
def test_sources_not_found(self, mock_robot_run):
|
|
339
|
+
task = create_task(
|
|
340
|
+
Robot,
|
|
341
|
+
{"suites": "test", "sources": ["bogus"]},
|
|
342
|
+
)
|
|
343
|
+
|
|
344
|
+
expected = "robot source 'bogus' could not be found"
|
|
345
|
+
with pytest.raises(TaskOptionsError, match=expected):
|
|
346
|
+
task()
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.robot_run")
|
|
350
|
+
def test_outputdir_return_value(mock_run, tmpdir):
|
|
351
|
+
"""Ensure that the task properly sets the outputdir return value"""
|
|
352
|
+
project_config = BaseProjectConfig(UniversalConfig())
|
|
353
|
+
|
|
354
|
+
test_dir = "test-dir"
|
|
355
|
+
tmpdir.mkdir(test_dir)
|
|
356
|
+
task = create_task(
|
|
357
|
+
Robot,
|
|
358
|
+
{
|
|
359
|
+
"suites": "test",
|
|
360
|
+
"options": {"outputdir": test_dir},
|
|
361
|
+
},
|
|
362
|
+
project_config=project_config,
|
|
363
|
+
)
|
|
364
|
+
mock_run.return_value = 0
|
|
365
|
+
task()
|
|
366
|
+
assert (Path.cwd() / test_dir).resolve() == Path(
|
|
367
|
+
task.return_values["robot_outputdir"]
|
|
368
|
+
).resolve()
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
class TestRobotTestDoc:
|
|
372
|
+
@mock.patch("cumulusci.tasks.robotframework.robotframework.testdoc")
|
|
373
|
+
def test_run_task(self, testdoc):
|
|
374
|
+
task = create_task(RobotTestDoc, {"path": ".", "output": "out"})
|
|
375
|
+
task()
|
|
376
|
+
testdoc.assert_called_once_with(".", "out")
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
class TestRobotLibDoc(MockLoggerMixin):
|
|
380
|
+
maxDiff = None
|
|
381
|
+
|
|
382
|
+
def setup_method(self):
|
|
383
|
+
self.tmpdir = tempfile.mkdtemp(dir=".")
|
|
384
|
+
self.task_config = TaskConfig()
|
|
385
|
+
self._task_log_handler.reset()
|
|
386
|
+
self.task_log = self._task_log_handler.messages
|
|
387
|
+
self.datadir = os.path.dirname(__file__)
|
|
388
|
+
|
|
389
|
+
def teardown_method(self):
|
|
390
|
+
shutil.rmtree(self.tmpdir)
|
|
391
|
+
|
|
392
|
+
def test_output_directory_not_exist(self):
|
|
393
|
+
"""Verify we catch an error if the output directory doesn't exist"""
|
|
394
|
+
path = os.path.join(self.datadir, "TestLibrary.py")
|
|
395
|
+
output = os.path.join(self.tmpdir, "bogus", "index.html")
|
|
396
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output})
|
|
397
|
+
# on windows, the output path may have backslashes which needs
|
|
398
|
+
# to be protected in the expected regex
|
|
399
|
+
expected = r"Unable to create output file '{}' (.*)".format(re.escape(output))
|
|
400
|
+
with pytest.raises(TaskOptionsError, match=expected):
|
|
401
|
+
task()
|
|
402
|
+
|
|
403
|
+
def test_validate_filenames(self):
|
|
404
|
+
"""Verify that we catch bad filenames early"""
|
|
405
|
+
expected = "Unable to find the following input files: 'bogus.py', 'bogus.robot'"
|
|
406
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
407
|
+
with pytest.raises(TaskOptionsError, match=expected):
|
|
408
|
+
create_task(RobotLibDoc, {"path": "bogus.py,bogus.robot", "output": output})
|
|
409
|
+
|
|
410
|
+
# there's a special path through the code if only one filename is bad...
|
|
411
|
+
expected = "Unable to find the input file 'bogus.py'"
|
|
412
|
+
with pytest.raises(TaskOptionsError, match=expected):
|
|
413
|
+
create_task(RobotLibDoc, {"path": "bogus.py", "output": output})
|
|
414
|
+
|
|
415
|
+
def test_task_log(self):
|
|
416
|
+
"""Verify that the task prints out the name of the output file"""
|
|
417
|
+
path = os.path.join(self.datadir, "TestLibrary.py")
|
|
418
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
419
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output})
|
|
420
|
+
task()
|
|
421
|
+
assert "created {}".format(output) in self.task_log["info"]
|
|
422
|
+
assert os.path.exists(output)
|
|
423
|
+
|
|
424
|
+
def test_comma_separated_list_of_files(self):
|
|
425
|
+
"""Verify that we properly parse a comma-separated list of files"""
|
|
426
|
+
path = "{},{}".format(
|
|
427
|
+
os.path.join(self.datadir, "TestLibrary.py"),
|
|
428
|
+
os.path.join(self.datadir, "TestResource.robot"),
|
|
429
|
+
)
|
|
430
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
431
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output})
|
|
432
|
+
task()
|
|
433
|
+
assert os.path.exists(output)
|
|
434
|
+
assert len(task.result["files"]) == 2
|
|
435
|
+
|
|
436
|
+
def test_glob_patterns(self):
|
|
437
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
438
|
+
path = os.path.join(self.datadir, "*Library.py")
|
|
439
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output})
|
|
440
|
+
task()
|
|
441
|
+
assert os.path.exists(output)
|
|
442
|
+
assert len(task.result["files"]) == 1
|
|
443
|
+
assert task.result["files"][0] == os.path.join(self.datadir, "TestLibrary.py")
|
|
444
|
+
|
|
445
|
+
def test_remove_duplicates(self):
|
|
446
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
447
|
+
path = os.path.join(self.datadir, "*Library.py")
|
|
448
|
+
task = create_task(RobotLibDoc, {"path": [path, path], "output": output})
|
|
449
|
+
task()
|
|
450
|
+
assert len(task.result["files"]) == 1
|
|
451
|
+
assert task.result["files"][0] == os.path.join(self.datadir, "TestLibrary.py")
|
|
452
|
+
|
|
453
|
+
def test_creates_output(self):
|
|
454
|
+
path = os.path.join(self.datadir, "TestLibrary.py")
|
|
455
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
456
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output})
|
|
457
|
+
task()
|
|
458
|
+
assert "created {}".format(output) in self.task_log["info"]
|
|
459
|
+
assert os.path.exists(output)
|
|
460
|
+
|
|
461
|
+
def test_pageobject(self):
|
|
462
|
+
"""Verify that we can parse a page object file"""
|
|
463
|
+
path = os.path.join(self.datadir, "TestPageObjects.py")
|
|
464
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
465
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output})
|
|
466
|
+
task()
|
|
467
|
+
assert "created {}".format(output) in self.task_log["info"]
|
|
468
|
+
assert os.path.exists(output)
|
|
469
|
+
|
|
470
|
+
def test_csv(self):
|
|
471
|
+
path = ",".join(
|
|
472
|
+
(
|
|
473
|
+
os.path.join(self.datadir, "TestLibrary.py"),
|
|
474
|
+
os.path.join(self.datadir, "TestResource.robot"),
|
|
475
|
+
os.path.join(self.datadir, "TestPageObjects.py"),
|
|
476
|
+
)
|
|
477
|
+
)
|
|
478
|
+
output = Path(self.tmpdir) / "keywords.csv"
|
|
479
|
+
if output.exists():
|
|
480
|
+
os.remove(output)
|
|
481
|
+
task = create_task(RobotLibDoc, {"path": path, "output": output.as_posix()})
|
|
482
|
+
task()
|
|
483
|
+
assert os.path.exists(output)
|
|
484
|
+
with open(output, "r", newline="") as csvfile:
|
|
485
|
+
reader = csv.reader(csvfile)
|
|
486
|
+
actual_output = [row for row in reader]
|
|
487
|
+
|
|
488
|
+
# not only does this verify that the expected keywords are in
|
|
489
|
+
# the output, but that the base class keywords are *not*
|
|
490
|
+
datadir = os.path.join("cumulusci", "tasks", "robotframework", "tests", "")
|
|
491
|
+
expected_output = [
|
|
492
|
+
["Name", "Source", "Line#", "po type", "po_object", "Documentation"],
|
|
493
|
+
[
|
|
494
|
+
"Keyword One",
|
|
495
|
+
f"{datadir}TestPageObjects.py",
|
|
496
|
+
"13",
|
|
497
|
+
"Listing",
|
|
498
|
+
"Something__c",
|
|
499
|
+
"",
|
|
500
|
+
],
|
|
501
|
+
[
|
|
502
|
+
"Keyword One",
|
|
503
|
+
f"{datadir}TestPageObjects.py",
|
|
504
|
+
"24",
|
|
505
|
+
"Detail",
|
|
506
|
+
"Something__c",
|
|
507
|
+
"",
|
|
508
|
+
],
|
|
509
|
+
[
|
|
510
|
+
"Keyword Three",
|
|
511
|
+
f"{datadir}TestPageObjects.py",
|
|
512
|
+
"30",
|
|
513
|
+
"Detail",
|
|
514
|
+
"Something__c",
|
|
515
|
+
"",
|
|
516
|
+
],
|
|
517
|
+
[
|
|
518
|
+
"Keyword Two",
|
|
519
|
+
f"{datadir}TestPageObjects.py",
|
|
520
|
+
"16",
|
|
521
|
+
"Listing",
|
|
522
|
+
"Something__c",
|
|
523
|
+
"",
|
|
524
|
+
],
|
|
525
|
+
[
|
|
526
|
+
"Keyword Two",
|
|
527
|
+
f"{datadir}TestPageObjects.py",
|
|
528
|
+
"27",
|
|
529
|
+
"Detail",
|
|
530
|
+
"Something__c",
|
|
531
|
+
"",
|
|
532
|
+
],
|
|
533
|
+
[
|
|
534
|
+
"Library Keyword One",
|
|
535
|
+
f"{datadir}TestLibrary.py",
|
|
536
|
+
"13",
|
|
537
|
+
"",
|
|
538
|
+
"",
|
|
539
|
+
"Keyword documentation with *bold* and _italics_",
|
|
540
|
+
],
|
|
541
|
+
[
|
|
542
|
+
"Library Keyword Two",
|
|
543
|
+
f"{datadir}TestLibrary.py",
|
|
544
|
+
"17",
|
|
545
|
+
"",
|
|
546
|
+
"",
|
|
547
|
+
"",
|
|
548
|
+
],
|
|
549
|
+
[
|
|
550
|
+
"Resource keyword one",
|
|
551
|
+
f"{datadir}TestResource.robot",
|
|
552
|
+
"2",
|
|
553
|
+
"",
|
|
554
|
+
"",
|
|
555
|
+
"",
|
|
556
|
+
],
|
|
557
|
+
[
|
|
558
|
+
"Resource keyword two",
|
|
559
|
+
f"{datadir}TestResource.robot",
|
|
560
|
+
"6",
|
|
561
|
+
"",
|
|
562
|
+
"",
|
|
563
|
+
"",
|
|
564
|
+
],
|
|
565
|
+
]
|
|
566
|
+
|
|
567
|
+
assert actual_output == expected_output
|
|
568
|
+
|
|
569
|
+
@mock.patch("cumulusci.tasks.robotframework.libdoc.view_file")
|
|
570
|
+
def test_preview_option(self, mock_view_file):
|
|
571
|
+
"""Verify that the 'preview' option results in calling the view_file method"""
|
|
572
|
+
path = os.path.join(self.datadir, "TestLibrary.py")
|
|
573
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
574
|
+
task = create_task(
|
|
575
|
+
RobotLibDoc, {"path": path, "output": output, "preview": True}
|
|
576
|
+
)
|
|
577
|
+
task()
|
|
578
|
+
mock_view_file.assert_called_once_with(output)
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
class TestRobotLibDocKeywordFile:
|
|
582
|
+
def setup_method(self):
|
|
583
|
+
self.tmpdir = tempfile.mkdtemp(dir=".")
|
|
584
|
+
|
|
585
|
+
def teardown_method(self):
|
|
586
|
+
shutil.rmtree(self.tmpdir)
|
|
587
|
+
|
|
588
|
+
def test_existing_file(self):
|
|
589
|
+
path = os.path.join(self.tmpdir, "keywords.py")
|
|
590
|
+
touch(path)
|
|
591
|
+
kwfile = KeywordFile(path)
|
|
592
|
+
assert kwfile.filename == "keywords.py"
|
|
593
|
+
assert kwfile.path == path
|
|
594
|
+
assert kwfile.keywords == {}
|
|
595
|
+
|
|
596
|
+
def test_file_as_module(self):
|
|
597
|
+
kwfile = KeywordFile("cumulusci.robotframework.Salesforce")
|
|
598
|
+
assert kwfile.filename == "Salesforce"
|
|
599
|
+
assert kwfile.path == "cumulusci.robotframework.Salesforce"
|
|
600
|
+
assert kwfile.keywords == {}
|
|
601
|
+
|
|
602
|
+
def test_add_keyword(self):
|
|
603
|
+
kwfile = KeywordFile("test.TestLibrary")
|
|
604
|
+
kwfile.add_keywords("the documentation...", ("Detail", "Contact"))
|
|
605
|
+
assert len(kwfile.keywords) == 1
|
|
606
|
+
assert kwfile.keywords[("Detail", "Contact")] == "the documentation..."
|
|
607
|
+
|
|
608
|
+
def test_to_tuples(self):
|
|
609
|
+
"""Test that to_tuples returns relative paths when possible
|
|
610
|
+
|
|
611
|
+
The code attempts to convert absolute paths to relative paths,
|
|
612
|
+
but if it can't then the path remains unchainged. This test generates
|
|
613
|
+
results with one file that is relative to cwd and one that is not.
|
|
614
|
+
"""
|
|
615
|
+
|
|
616
|
+
here = os.path.dirname(__file__)
|
|
617
|
+
path = Path(here) / "TestLibrary.py"
|
|
618
|
+
libdoc = LibraryDocBuilder().build(str(path))
|
|
619
|
+
|
|
620
|
+
# we'll set the first to a non-relative directory and leave
|
|
621
|
+
# the other one relative to here (assuming that `here` is
|
|
622
|
+
# relative to cwd)
|
|
623
|
+
absolute_path = str(Path("/bogus/whatever.py"))
|
|
624
|
+
libdoc.keywords[0].source = absolute_path
|
|
625
|
+
|
|
626
|
+
# The returned result is a set, so the order is indeterminate. That's
|
|
627
|
+
# why the following line sorts it.
|
|
628
|
+
kwfile = KeywordFile("Whatever")
|
|
629
|
+
kwfile.add_keywords(libdoc)
|
|
630
|
+
rows = sorted(kwfile.to_tuples())
|
|
631
|
+
|
|
632
|
+
# verify the absolute path remains absolute
|
|
633
|
+
assert rows[0][1] == absolute_path
|
|
634
|
+
# verify that the path to a file under cwd is relative
|
|
635
|
+
assert rows[1][1] == str(path.relative_to(os.getcwd()))
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
class TestRobotLibDocOutput:
|
|
639
|
+
"""Tests for the generated robot keyword documentation"""
|
|
640
|
+
|
|
641
|
+
def setup_method(self):
|
|
642
|
+
self.tmpdir = tempfile.mkdtemp(dir=".")
|
|
643
|
+
self.datadir = os.path.dirname(__file__)
|
|
644
|
+
path = [
|
|
645
|
+
os.path.join(self.datadir, "TestLibrary.py"),
|
|
646
|
+
os.path.join(self.datadir, "TestResource.robot"),
|
|
647
|
+
]
|
|
648
|
+
output = os.path.join(self.tmpdir, "index.html")
|
|
649
|
+
self.task = create_task(
|
|
650
|
+
RobotLibDoc,
|
|
651
|
+
{"path": path, "output": output, "title": "Keyword Documentation, yo."},
|
|
652
|
+
)
|
|
653
|
+
self.task()
|
|
654
|
+
docroot = ET.parse(output).getroot()
|
|
655
|
+
self.html_body = docroot.find("body")
|
|
656
|
+
|
|
657
|
+
def teardown_method(self):
|
|
658
|
+
shutil.rmtree(self.tmpdir)
|
|
659
|
+
|
|
660
|
+
def test_output_title(self):
|
|
661
|
+
"""Verify the document has the expected title"""
|
|
662
|
+
title_element = self.html_body.find(
|
|
663
|
+
".//div[@class='header']/h1[@class='title']"
|
|
664
|
+
)
|
|
665
|
+
assert title_element is not None
|
|
666
|
+
assert title_element.text.strip() == "Keyword Documentation, yo."
|
|
667
|
+
|
|
668
|
+
def test_formatted_documentation(self):
|
|
669
|
+
"""Verify that markup in the documentation is rendered as html"""
|
|
670
|
+
doc_element = self.html_body.find(
|
|
671
|
+
".//tr[@id='TestLibrary.py.Library-Keyword-One']//td[@class='kwdoc']"
|
|
672
|
+
)
|
|
673
|
+
doc_html = str(ET.tostring(doc_element, method="html").strip())
|
|
674
|
+
# we could just do an assert on the full markup of the
|
|
675
|
+
# element, but it seems likely that could fail for benign
|
|
676
|
+
# regions (extra whitespace, for example). So we'll just make
|
|
677
|
+
# sure there are a couple of expected formatted elements.
|
|
678
|
+
assert "<b>bold</b>" in doc_html
|
|
679
|
+
assert "<i>italics</i>" in doc_html
|
|
680
|
+
|
|
681
|
+
def test_output_sections(self):
|
|
682
|
+
"""Verify that the output has a section for each file"""
|
|
683
|
+
sections = self.html_body.findall(".//div[@class='file']")
|
|
684
|
+
section_titles = [
|
|
685
|
+
x.find(".//div[@class='file-header']/h2").text for x in sections
|
|
686
|
+
]
|
|
687
|
+
assert len(sections) == 2, "expected to find 2 sections, found {}".format(
|
|
688
|
+
len(sections)
|
|
689
|
+
)
|
|
690
|
+
assert section_titles == ["TestLibrary.py", "TestResource.robot"]
|
|
691
|
+
|
|
692
|
+
def test_output_keywords(self):
|
|
693
|
+
"""Verify that all keywords in the libraries are represented in the output file"""
|
|
694
|
+
keyword_rows = self.html_body.findall(".//tr[@class='kwrow']")
|
|
695
|
+
keywords = [x.find(".//td[@class='kwname']") for x in keyword_rows]
|
|
696
|
+
keyword_names = [x.text.strip() for x in keywords]
|
|
697
|
+
assert len(keywords) == 4
|
|
698
|
+
assert keyword_names == [
|
|
699
|
+
"Library Keyword One",
|
|
700
|
+
"Library Keyword Two",
|
|
701
|
+
"Resource keyword one",
|
|
702
|
+
"Resource keyword two",
|
|
703
|
+
]
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
class TestLibdocPageObjects:
|
|
707
|
+
"""Tests for generating docs for page objects"""
|
|
708
|
+
|
|
709
|
+
def setup_method(self):
|
|
710
|
+
self.tmpdir = tempfile.mkdtemp(dir=".")
|
|
711
|
+
self.datadir = os.path.dirname(__file__)
|
|
712
|
+
path = [os.path.join(self.datadir, "TestPageObjects.py")]
|
|
713
|
+
self.output = os.path.join(self.tmpdir, "index.html")
|
|
714
|
+
self.task = create_task(
|
|
715
|
+
RobotLibDoc,
|
|
716
|
+
{"path": path, "output": self.output, "title": "Keyword Documentation, yo"},
|
|
717
|
+
)
|
|
718
|
+
self.task()
|
|
719
|
+
|
|
720
|
+
self.docroot = ET.parse(self.output).getroot()
|
|
721
|
+
self.html_body = self.docroot.find("body")
|
|
722
|
+
|
|
723
|
+
def teardown_method(self):
|
|
724
|
+
shutil.rmtree(self.tmpdir)
|
|
725
|
+
|
|
726
|
+
def test_file_title(self):
|
|
727
|
+
"""Verify that the TITLE in the file is added to the generated html"""
|
|
728
|
+
# The page object file has a TITLE attribute and a docstring;
|
|
729
|
+
# make sure they are picked up.
|
|
730
|
+
title_element = self.html_body.find(".//div[@class='file-header']/h2")
|
|
731
|
+
assert title_element.text == "This is the title"
|
|
732
|
+
|
|
733
|
+
def test_file_description(self):
|
|
734
|
+
"""Verify that the docstring in the file is added to the generated html"""
|
|
735
|
+
file_doc_element = self.html_body.find(
|
|
736
|
+
".//div[@class='pageobject-file-description']"
|
|
737
|
+
)
|
|
738
|
+
description = ET.tostring(file_doc_element).decode("utf-8").strip()
|
|
739
|
+
assert (
|
|
740
|
+
description
|
|
741
|
+
== '<div class="pageobject-file-description"><p>this is the docstring</p></div>'
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
def test_pageobject_sections(self):
|
|
745
|
+
# the TestPageObjects.py file has two page objects,
|
|
746
|
+
# one with two keywords and one with three
|
|
747
|
+
sections = self.html_body.findall(".//div[@class='pageobject-header']")
|
|
748
|
+
assert len(sections) == 2
|
|
749
|
+
|
|
750
|
+
def test_pageobject_docstring(self):
|
|
751
|
+
section = self.html_body.find(".//div[@pageobject='Detail-Something__c']")
|
|
752
|
+
description = section.find("div[@class='description']")
|
|
753
|
+
expected = '<div class="description" title="Description"><p>Description of SomethingDetailPage</p></div>'
|
|
754
|
+
actual = ET.tostring(description).decode("utf-8").strip()
|
|
755
|
+
assert shrinkws(actual) == shrinkws(expected)
|
|
756
|
+
|
|
757
|
+
section = self.html_body.find(".//div[@pageobject='Listing-Something__c']")
|
|
758
|
+
description = section.find("div[@class='description']")
|
|
759
|
+
expected = '<div class="description" title="Description"><p>Description of SomethingListingPage</p></div>'
|
|
760
|
+
actual = ET.tostring(description).decode("utf-8").strip()
|
|
761
|
+
assert shrinkws(actual) == shrinkws(expected)
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
class TestRobotPerformanceKeywords:
|
|
765
|
+
def setup_method(self):
|
|
766
|
+
self.datadir = os.path.dirname(__file__)
|
|
767
|
+
|
|
768
|
+
@contextmanager
|
|
769
|
+
def _run_robot_and_parse_xml(
|
|
770
|
+
self, test_pattern, suite_path="tests/salesforce/performance.robot"
|
|
771
|
+
):
|
|
772
|
+
universal_config = UniversalConfig()
|
|
773
|
+
project_config = BaseProjectConfig(universal_config)
|
|
774
|
+
with temporary_dir() as d, mock.patch(
|
|
775
|
+
"cumulusci.robotframework.Salesforce.Salesforce._init_locators"
|
|
776
|
+
), responses.RequestsMock():
|
|
777
|
+
project_config.repo_info["root"] = d
|
|
778
|
+
suite = Path(self.datadir) / "../../../robotframework/" / suite_path
|
|
779
|
+
task = create_task(
|
|
780
|
+
Robot,
|
|
781
|
+
{
|
|
782
|
+
"test": test_pattern,
|
|
783
|
+
"suites": str(suite),
|
|
784
|
+
"options": {"outputdir": d, "skiponfailure": "noncritical"},
|
|
785
|
+
},
|
|
786
|
+
project_config=project_config,
|
|
787
|
+
)
|
|
788
|
+
task()
|
|
789
|
+
logger_func = mock.Mock()
|
|
790
|
+
log_perf_summary_from_xml(Path(d) / "output.xml", logger_func)
|
|
791
|
+
yield logger_func.mock_calls
|
|
792
|
+
|
|
793
|
+
def parse_metric(self, metric):
|
|
794
|
+
name, value = metric.split(": ")
|
|
795
|
+
value = value.strip("s ") # strip seconds unit
|
|
796
|
+
try:
|
|
797
|
+
value = float(value)
|
|
798
|
+
except ValueError:
|
|
799
|
+
raise Exception(f"Cannot convert to float {value}")
|
|
800
|
+
return name.strip(), value
|
|
801
|
+
|
|
802
|
+
def extract_times(self, pattern, call):
|
|
803
|
+
first_arg = call[1][0]
|
|
804
|
+
if pattern in first_arg:
|
|
805
|
+
metrics = first_arg.split("-")[-1].split(",")
|
|
806
|
+
return dict(self.parse_metric(metric) for metric in metrics)
|
|
807
|
+
|
|
808
|
+
def test_parser_FOR_and_IF(self):
|
|
809
|
+
# verify that metrics nested inside a FOR or IF are accounted for
|
|
810
|
+
pattern = "Test FOR and IF statements"
|
|
811
|
+
suite_path = Path(self.datadir) / "performance.robot"
|
|
812
|
+
with self._run_robot_and_parse_xml(
|
|
813
|
+
pattern, suite_path=suite_path
|
|
814
|
+
) as logger_calls:
|
|
815
|
+
elapsed_times = [self.extract_times(pattern, call) for call in logger_calls]
|
|
816
|
+
perf_data = list(filter(None, elapsed_times))[0]
|
|
817
|
+
assert perf_data["plugh"] == 4.0
|
|
818
|
+
assert perf_data["xyzzy"] == 2.0
|
|
819
|
+
|
|
820
|
+
def test_elapsed_time_xml(self):
|
|
821
|
+
pattern = "Elapsed Time: "
|
|
822
|
+
|
|
823
|
+
with self._run_robot_and_parse_xml("Test Perf*") as logger_calls:
|
|
824
|
+
elapsed_times = [self.extract_times(pattern, call) for call in logger_calls]
|
|
825
|
+
elapsed_times = [next(iter(x.values())) for x in elapsed_times if x]
|
|
826
|
+
elapsed_times.sort()
|
|
827
|
+
|
|
828
|
+
assert elapsed_times[1:] == [53, 11655.9, 18000.0]
|
|
829
|
+
assert float(elapsed_times[0]) < 3
|
|
830
|
+
|
|
831
|
+
def test_metrics(self):
|
|
832
|
+
pattern = "Max_CPU_Percent: "
|
|
833
|
+
with self._run_robot_and_parse_xml(
|
|
834
|
+
"Test Perf Measure Other Metric"
|
|
835
|
+
) as logger_calls:
|
|
836
|
+
elapsed_times = [self.extract_times(pattern, call) for call in logger_calls]
|
|
837
|
+
assert list(filter(None, elapsed_times))[0]["Max_CPU_Percent"] == 30.0
|
|
838
|
+
|
|
839
|
+
def test_empty_test(self):
|
|
840
|
+
pattern = "Max_CPU_Percent: "
|
|
841
|
+
with self._run_robot_and_parse_xml(
|
|
842
|
+
"Test Perf Measure Other Metric"
|
|
843
|
+
) as logger_calls:
|
|
844
|
+
elapsed_times = [self.extract_times(pattern, call) for call in logger_calls]
|
|
845
|
+
assert list(filter(None, elapsed_times))[0]["Max_CPU_Percent"] == 30.0
|
|
846
|
+
|
|
847
|
+
def test_explicit_failures(self):
|
|
848
|
+
pattern = "Elapsed Time: "
|
|
849
|
+
suite_path = Path(self.datadir) / "failing_tests.robot"
|
|
850
|
+
with self._run_robot_and_parse_xml(
|
|
851
|
+
"Test *", suite_path=suite_path
|
|
852
|
+
) as logger_calls:
|
|
853
|
+
elapsed_times = [self.extract_times(pattern, call) for call in logger_calls]
|
|
854
|
+
assert list(filter(None, elapsed_times)) == [
|
|
855
|
+
{"Elapsed Time": 11655.9, "Donuts": 42.3}
|
|
856
|
+
]
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
def shrinkws(s):
|
|
860
|
+
return re.sub(r"\s+", " ", s).replace("> <", "><")
|