Skip to content

Commit

Permalink
Merge pull request #1649 from SFDO-Tooling/feature/3.10.0
Browse files Browse the repository at this point in the history
prepare 3.10.0
  • Loading branch information
David Glick authored Apr 2, 2020
2 parents d521063 + fef8b2d commit 5d8c0bc
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build_homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build Homebrew formula

on:
release:
types:
- created

jobs:
build:
name: Build Homebrew formula
runs-on: macos-10.15
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Build formula
run: |
utility/build-homebrew.sh cumulusci.rb
- name: Test formula
run: |
brew audit cumulusci.rb
brew install cumulusci.rb
brew test cumulusci.rb
- name: Create branch in homebrew-sfdo repository
run: |
VERSION=$(python setup.py --version)
BRANCH="cci-$VERSION"
git clone https://HOMEBREW_GITHUB_USER:[email protected]/SFDO-Tooling/homebrew-sfdo.git
cd homebrew-sfdo
git checkout -b $BRANCH
cp ../cumulusci.rb ./
git add cumulusci.rb
git commit -m "Bump cumulusci to version $VERSION"
git push origin $BRANCH
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Abort for dev version
run: grep dev cumulusci/version.txt
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
Expand Down
14 changes: 14 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
History
=======

3.10.0 (2020-04-02)
-------------------

Changes:

* Added ``custom_settings_value_wait`` task to wait for a custom setting to have a particular value.

* The ``metadeploy_publish`` task now has a ``labels_path`` option which specifies a folder to store translations. After publishing a plan, labels_en.json will be updated with the untranslated labels from the plan. Before publishing a plan, labels from other languages will be published to MetaDeploy.

Issues closed:

* Fixed an issue where running subprocesses could hang if too much output was buffered.


3.9.1 (2020-03-25)
------------------

Expand Down
126 changes: 126 additions & 0 deletions cumulusci/tasks/salesforce/tests/test_custom_settings_wait.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import unittest
from unittest.mock import MagicMock, patch

import responses

from cumulusci.core.config import (
BaseGlobalConfig,
BaseProjectConfig,
OrgConfig,
TaskConfig,
)
from cumulusci.core.keychain import BaseProjectKeychain
from cumulusci.core.exceptions import SalesforceException
from cumulusci.tasks.salesforce.custom_settings_wait import CustomSettingValueWait
from cumulusci.core.tests.utils import MockLoggerMixin


@patch(
"cumulusci.tasks.salesforce.BaseSalesforceTask._update_credentials",
MagicMock(return_value=None),
)
class TestRunCustomSettingsWait(MockLoggerMixin, unittest.TestCase):
def setUp(self):
self.api_version = 42.0
self.global_config = BaseGlobalConfig(
{"project": {"api_version": self.api_version}}
)
self.task_config = TaskConfig()
self.project_config = BaseProjectConfig(
self.global_config, config={"noyaml": True}
)
self.project_config.config["project"] = {
"package": {"api_version": self.api_version}
}
keychain = BaseProjectKeychain(self.project_config, "")
self.project_config.set_keychain(keychain)
self.org_config = OrgConfig(
{
"id": "foo/1",
"instance_url": "https://example.com",
"access_token": "abc123",
},
"test",
)
self.base_normal_url = "{}/services/data/v{}/query/".format(
self.org_config.instance_url, self.api_version
)
self.task_log = self._task_log_handler.messages

def _get_query_resp(self):
return {
"size": 1,
"totalSize": 1,
"done": True,
"queryLocator": None,
"entityTypeName": "Customizable_Rollup_Setings__c",
"records": [
{
"attributes": {
"type": "Customizable_Rollup_Setings__c",
"url": "/services/data/v47.0/sobjects/Customizable_Rollup_Setings__c/707L0000014nnPHIAY",
},
"Id": "707L0000014nnPHIAY",
"SetupOwnerId": "00Dxxxxxxxxxxxx",
"Customizable_Rollups_Enabled__c": True,
"Rollups_Account_Batch_Size__c": 200,
}
],
}

def _get_url_and_task(self):
task = CustomSettingValueWait(
self.project_config, self.task_config, self.org_config
)
url = self.base_normal_url
return task, url

@responses.activate
def test_run_custom_settings_wait_match_bool(self):
self.task_config.config["options"] = {
"object": "Customizable_Rollup_Setings__c",
"field": "Customizable_Rollups_Enabled__c",
"value": True,
"poll_interval": 1,
}

task, url = self._get_url_and_task()
response = self._get_query_resp()
response["records"][0]["Customizable_Rollups_Enabled__c"] = True
responses.add(responses.GET, url, json=response)
task()

@responses.activate
def test_run_custom_settings_wait_match_int(self):
self.task_config.config["options"] = {
"object": "Customizable_Rollup_Setings__c",
"field": "Rollups_Account_Batch_Size__c",
"value": 200,
"poll_interval": 1,
}

task, url = self._get_url_and_task()
response = self._get_query_resp()
response["records"][0]["Rollups_Account_Batch_Size__c"] = 200
responses.add(responses.GET, url, json=response)
task()

@responses.activate
def test_run_custom_settings_wait_bad_object(self):
self.task_config.config["options"] = {
"object": "Customizable_Rollup_Setings__c",
"field": "Rollups_Account_Batch_Size__c",
"value": 200,
"poll_interval": 1,
}

task, url = self._get_url_and_task()
response = self._get_query_resp()
response["records"][0]["SetupOwnerId"] = "00X"
responses.add(responses.GET, url, json=response)
# task()

with self.assertRaises(SalesforceException) as e:
task()

assert "found" in str(e.exception)
2 changes: 1 addition & 1 deletion cumulusci/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.0.dev1
3.10.0

0 comments on commit 5d8c0bc

Please sign in to comment.