~viswesn/juju-ci-tools/aws_boto3

« back to all changes in this revision

Viewing changes to tests/test_perfscale_controller_stress.py

Perfscale tests are now passed pprof objects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    def test_returns_DeployDetails(self):
31
31
        args = _get_default_args(deploy_amount=0)
32
32
        client = Mock()
 
33
        pprof_collector = Mock()
33
34
 
34
 
        deploy_details = pcs.assess_controller_stress(client, args)
 
35
        deploy_details = pcs.assess_controller_stress(
 
36
            client, pprof_collector, args)
35
37
 
36
38
        self.assertIs(type(deploy_details), DeployDetails)
37
39
        self.assertEqual(deploy_details.name, 'Controller Stress.')
39
41
    def test_deploys_and_adds_units(self):
40
42
        args = _get_default_args(deploy_amount=1)
41
43
        client = Mock()
 
44
        pprof_collector = Mock()
42
45
 
43
46
        with patch.object(
44
47
                pcs, 'deploy_swarm_to_new_model', autospec=True) as m_dsnm:
45
 
            pcs.assess_controller_stress(client, args)
 
48
            pcs.assess_controller_stress(client, pprof_collector, args)
46
49
        m_dsnm.assert_called_once_with(client, 'swarm-model-0')
47
50
 
48
51
    def test_stores_deploytimes(self):
52
55
        comparison_timing = TimingData(start, end)
53
56
        args = _get_default_args(deploy_amount=0)
54
57
        client = Mock()
 
58
        pprof_collector = Mock()
55
59
 
56
60
        with patch.object(pcs, 'datetime', autospec=True) as m_dt:
57
61
            m_dt.utcnow.side_effect = times
58
 
            deploy_details = pcs.assess_controller_stress(client, args)
 
62
            deploy_details = pcs.assess_controller_stress(
 
63
                client, pprof_collector, args)
59
64
        deploy_timing = deploy_details.timings
60
65
        self.assertEqual(deploy_timing.start, comparison_timing.start)
61
66
        self.assertEqual(deploy_timing.end, comparison_timing.end)