Merge lp:~sseman/juju-ci-tools/client-server-concurrent into lp:juju-ci-tools

Proposed by Seman
Status: Merged
Merged at revision: 1114
Proposed branch: lp:~sseman/juju-ci-tools/client-server-concurrent
Merge into: lp:juju-ci-tools
Diff against target: 93 lines (+47/-5)
2 files modified
schedule_hetero_control.py (+4/-1)
tests/test_schedule_hetero_control.py (+43/-4)
To merge this branch: bzr merge lp:~sseman/juju-ci-tools/client-server-concurrent
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+272460@code.launchpad.net

Description of the change

This branch splits scheduling the client-server tests into three jobs: compatibility-control, compatibility-control-osx and compatibility-control-windows.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'schedule_hetero_control.py'
--- schedule_hetero_control.py 2015-09-03 19:04:07 +0000
+++ schedule_hetero_control.py 2015-09-25 18:22:31 +0000
@@ -78,8 +78,11 @@
78def build_jobs(credentials, root, jobs):78def build_jobs(credentials, root, jobs):
79 jenkins = Jenkins('http://localhost:8080', *credentials)79 jenkins = Jenkins('http://localhost:8080', *credentials)
80 token = get_auth_token(root, 'compatibility-control')80 token = get_auth_token(root, 'compatibility-control')
81 os_str = {"ubuntu": "", "osx": "-osx", "windows": "-windows"}
81 for job in jobs:82 for job in jobs:
82 jenkins.build_job('compatibility-control', job, token=token)83 jenkins.build_job(
84 'compatibility-control{}'.format(os_str[job['client_os']]), job,
85 token=token)
8386
8487
85def main():88def main():
8689
=== modified file 'tests/test_schedule_hetero_control.py'
--- tests/test_schedule_hetero_control.py 2015-09-22 22:41:12 +0000
+++ tests/test_schedule_hetero_control.py 2015-09-25 18:22:31 +0000
@@ -1,12 +1,17 @@
1from __future__ import print_function1from __future__ import print_function
22
3__metaclass__ = type
4
3from datetime import timedelta5from datetime import timedelta
4import json6import json
5import os7import os
6from time import time8from time import time
7from unittest import TestCase9from unittest import TestCase
810
9from mock import patch11from mock import (
12 call,
13 patch,
14)
1015
11from jujuci import Credentials16from jujuci import Credentials
12from schedule_hetero_control import (17from schedule_hetero_control import (
@@ -20,9 +25,6 @@
20from test_utility import write_config25from test_utility import write_config
2126
2227
23__metaclass__ = type
24
25
26class TestScheduleHeteroControl(TestCase):28class TestScheduleHeteroControl(TestCase):
2729
28 def test_get_args_credentials(self):30 def test_get_args_credentials(self):
@@ -56,6 +58,43 @@
56 jenkins_mock.assert_called_once_with(58 jenkins_mock.assert_called_once_with(
57 'http://localhost:8080', 'jrandom', 'password1')59 'http://localhost:8080', 'jrandom', 'password1')
5860
61 def test_build_jobs(self):
62 credentials = Credentials('jrandom', 'password1')
63 jobs = []
64 for os_str in ('ubuntu', 'osx', 'windows'):
65 jobs.append({
66 'old_version': "1.18.4",
67 'candidate': "1.24.5",
68 'new_to_old': 'true',
69 'candidate_path': "1.24.5",
70 'client_os': os_str,
71 'revision_build': "2999"
72 })
73 calls = [
74 call('compatibility-control',
75 {'candidate_path': '1.24.5', 'candidate': '1.24.5',
76 'new_to_old': 'true', 'revision_build': '2999',
77 'old_version': '1.18.4', 'client_os': 'ubuntu'},
78 token='asdf'),
79 call('compatibility-control-osx',
80 {'candidate_path': '1.24.5', 'candidate': '1.24.5',
81 'new_to_old': 'true', 'revision_build': '2999',
82 'old_version': '1.18.4', 'client_os': 'osx'}, token='asdf'),
83 call('compatibility-control-windows',
84 {'candidate_path': '1.24.5', 'candidate': '1.24.5',
85 'new_to_old': 'true', 'revision_build': '2999',
86 'old_version': '1.18.4', 'client_os': 'windows'},
87 token='asdf')]
88 with temp_dir() as root:
89 write_config(root, 'compatibility-control', 'asdf')
90 with patch('schedule_hetero_control.Jenkins',
91 autospec=True) as jenkins_mock:
92 build_jobs(credentials, root, jobs)
93 jenkins_mock.assert_called_once_with(
94 'http://localhost:8080', 'jrandom', 'password1')
95 self.assertEqual(
96 jenkins_mock.return_value.build_job.call_args_list, calls)
97
5998
60class TestGetCandidateInfo(TestCase):99class TestGetCandidateInfo(TestCase):
61 def test_get_candidate_info(self):100 def test_get_candidate_info(self):

Subscribers

People subscribed via source and target branches