Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

Commit

Permalink
pulselistener: Update try_task_config format (#1928)
Browse files Browse the repository at this point in the history
  • Loading branch information
La0 authored and marco-c committed Mar 5, 2019
1 parent 56e4235 commit 12314bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
11 changes: 5 additions & 6 deletions src/pulselistener/pulselistener/mercurial.py
Expand Up @@ -127,12 +127,11 @@ async def handle_diff(self, diff):
# Build and commit try_task_config.json
config_path = os.path.join(self.repo_dir, 'try_task_config.json')
config = {
'version': 1,
'tasks': [],
'templates': {
'env': {
'PHABRICATOR_DIFF': diff['phid'],
}
'version': 2,
'parameters': {
'target_tasks_method': 'codereview',
'optimize_target_tasks': True,
'phabricator_diff': diff['phid'],
}
}
with open(config_path, 'w') as f:
Expand Down
22 changes: 10 additions & 12 deletions src/pulselistener/tests/test_mercurial.py
Expand Up @@ -50,12 +50,11 @@ async def test_push_to_try(PhabricatorMock, RepoMock):
# Check the try_task_config file
assert os.path.exists(config)
assert json.load(open(config)) == {
'version': 1,
'tasks': [],
'templates': {
'env': {
'PHABRICATOR_DIFF': 'PHID-DIFF-test123',
}
'version': 2,
'parameters': {
'target_tasks_method': 'codereview',
'optimize_target_tasks': True,
'phabricator_diff': 'PHID-DIFF-test123',
}
}

Expand Down Expand Up @@ -129,12 +128,11 @@ def _readme(content):
# Check the try_task_config file
assert os.path.exists(config)
assert json.load(open(config)) == {
'version': 1,
'tasks': [],
'templates': {
'env': {
'PHABRICATOR_DIFF': 'PHID-DIFF-solo',
}
'version': 2,
'parameters': {
'target_tasks_method': 'codereview',
'optimize_target_tasks': True,
'phabricator_diff': 'PHID-DIFF-solo',
}
}

Expand Down

0 comments on commit 12314bf

Please sign in to comment.