Increase test coverage to 90% for non-generated code

Bug #1511667 reported by Tom Cammann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Low
Spyros Trigazis

Bug Description

After running tox -ecover and parsing the output here are the results for classes that need increased test coverage:

  % Name
------------------------------------------------
100% magnum/__init__.py
100% magnum/api/__init__.py
100% magnum/api/app.py
100% magnum/api/attr_validator.py
100% magnum/api/config.py
100% magnum/api/controllers/__init__.py
97% magnum/api/controllers/base.py
91% magnum/api/controllers/link.py
100% magnum/api/controllers/root.py
100% magnum/api/controllers/v1/__init__.py
93% magnum/api/controllers/v1/bay.py
96% magnum/api/controllers/v1/baymodel.py
93% magnum/api/controllers/v1/certificate.py
91% magnum/api/controllers/v1/cluster.py
96% magnum/api/controllers/v1/cluster_template.py
100% magnum/api/controllers/v1/collection.py
100% magnum/api/controllers/v1/magnum_services.py
99% magnum/api/controllers/v1/types.py
98% magnum/api/controllers/versions.py
100% magnum/api/expose.py
100% magnum/api/hooks.py
45% magnum/api/http_error.py
100% magnum/api/middleware/__init__.py
84% magnum/api/middleware/auth_token.py
88% magnum/api/middleware/parsable_error.py
100% magnum/api/servicegroup.py
100% magnum/api/utils.py
96% magnum/api/validation.py
88% magnum/api/versioned_method.py
100% magnum/cmd/__init__.py
100% magnum/cmd/api.py
100% magnum/cmd/conductor.py
100% magnum/cmd/db_manage.py
100% magnum/cmd/template_manage.py
100% magnum/common/__init__.py
100% magnum/common/cert_manager/__init__.py
89% magnum/common/cert_manager/barbican_cert_manager.py
100% magnum/common/cert_manager/cert_manager.py
97% magnum/common/cert_manager/local_cert_manager.py
100% magnum/common/cert_manager/x509keypair_cert_manager.py
94% magnum/common/clients.py
100% magnum/common/config.py
95% magnum/common/context.py
48% magnum/common/docker_utils.py
90% magnum/common/exception.py
86% magnum/common/k8s_manifest.py
83% magnum/common/keystone.py
100% magnum/common/name_generator.py
76% magnum/common/paths.py
100% magnum/common/policy.py
61% magnum/common/rpc.py
58% magnum/common/rpc_service.py
87% magnum/common/safe_utils.py
100% magnum/common/service.py
94% magnum/common/short_id.py
86% magnum/common/urlfetch.py
86% magnum/common/utils.py
100% magnum/common/x509/__init__.py
100% magnum/common/x509/config.py
100% magnum/common/x509/extensions.py
97% magnum/common/x509/operations.py
75% magnum/common/x509/validator.py
89% magnum/common/yamlutils.py
100% magnum/conductor/__init__.py
84% magnum/conductor/api.py
100% magnum/conductor/config.py
100% magnum/conductor/handlers/__init__.py
88% magnum/conductor/handlers/bay_conductor.py
100% magnum/conductor/handlers/ca_conductor.py
100% magnum/conductor/handlers/common/__init__.py
78% magnum/conductor/handlers/common/cert_manager.py
93% magnum/conductor/handlers/common/trust_manager.py
100% magnum/conductor/handlers/conductor_listener.py
87% magnum/conductor/handlers/indirection_api.py
29% magnum/conductor/k8s_api.py
95% magnum/conductor/k8s_monitor.py
98% magnum/conductor/mesos_monitor.py
91% magnum/conductor/monitors.py
96% magnum/conductor/scale_manager.py
97% magnum/conductor/swarm_monitor.py
100% magnum/conductor/tasks/__init__.py
100% magnum/conductor/tasks/heat_tasks.py
100% magnum/conductor/utils.py
100% magnum/db/__init__.py
100% magnum/db/api.py
47% magnum/db/migration.py
100% magnum/db/sqlalchemy/__init__.py
100% magnum/db/sqlalchemy/alembic/env.py
90% magnum/db/sqlalchemy/api.py
86% magnum/db/sqlalchemy/migration.py
93% magnum/db/sqlalchemy/models.py
100% magnum/drivers/__init__.py
100% magnum/drivers/common/__init__.py
97% magnum/drivers/common/k8s_template_def.py
92% magnum/drivers/common/template_def.py
100% magnum/drivers/k8s_coreos_v1/__init__.py
86% magnum/drivers/k8s_coreos_v1/template_def.py
0% magnum/drivers/k8s_coreos_v1/version.py
100% magnum/drivers/k8s_fedora_atomic_v1/__init__.py
88% magnum/drivers/k8s_fedora_atomic_v1/template_def.py
0% magnum/drivers/k8s_fedora_atomic_v1/version.py
100% magnum/drivers/mesos_ubuntu_v1/__init__.py
98% magnum/drivers/mesos_ubuntu_v1/template_def.py
0% magnum/drivers/mesos_ubuntu_v1/version.py
100% magnum/drivers/swarm_fedora_atomic_v1/__init__.py
96% magnum/drivers/swarm_fedora_atomic_v1/template_def.py
0% magnum/drivers/swarm_fedora_atomic_v1/version.py
100% magnum/hacking/__init__.py
89% magnum/hacking/checks.py
85% magnum/i18n.py
100% magnum/objects/__init__.py
90% magnum/objects/base.py
100% magnum/objects/bay.py
100% magnum/objects/certificate.py
100% magnum/objects/cluster_template.py
100% magnum/objects/fields.py
100% magnum/objects/magnum_service.py
100% magnum/objects/x509keypair.py
100% magnum/opts.py
100% magnum/service/__init__.py
95% magnum/service/periodic.py
100% magnum/servicegroup/__init__.py
93% magnum/servicegroup/magnum_service_periodic.py
100% magnum/version.py
---------------------------------------------------
90% TOTAL

Changed in magnum:
status: New → Confirmed
importance: Undecided → Low
tags: added: low-hanging-fruit
Peiyu Lin (mathspanda)
Changed in magnum:
assignee: nobody → Peiyu Lin (mathspanda)
Adrian Otto (aotto)
Changed in magnum:
milestone: none → mitaka-1
Peiyu Lin (mathspanda)
Changed in magnum:
assignee: Peiyu Lin (mathspanda) → nobody
Changed in magnum:
assignee: nobody → HouMing Wang (houming-wang)
Revision history for this message
chandan kumar (chkumar246) wrote :

Is this still pending and what is the current coverage?

Larry Rensing (lr699s)
Changed in magnum:
assignee: HouMing Wang (houming-wang) → Larry Rensing (lr699s)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/333335

Changed in magnum:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/333335
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=91d8aa4fc5ba5bc7941c5bddcea4da24673dadce
Submitter: Jenkins
Branch: master

commit 91d8aa4fc5ba5bc7941c5bddcea4da24673dadce
Author: Larry Rensing <email address hidden>
Date: Wed Jun 22 19:28:49 2016 +0000

    Improve unit test coverage

    Added unit tests to test_types.py and test_magnum_service.py. Also, lines
    containing abstract methods and 'pass' were being counted in the coverage
     metrics, so those were added to the coveragerc.

    Change-Id: I4af7005453b8f843b640661a972b3f1689ed7dd0
    Partial-Bug: #1511667

Changed in magnum:
milestone: mitaka-1 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/353250

Changed in magnum:
assignee: Larry Rensing (lr699s) → rajiv (rajiv-kumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/353358

Changed in magnum:
assignee: rajiv (rajiv-kumar) → Hieu LE (hieulq)
Changed in magnum:
assignee: Hieu LE (hieulq) → rajiv (rajiv-kumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/353824

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/353839

Changed in magnum:
assignee: rajiv (rajiv-kumar) → Hieu LE (hieulq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/353848

Changed in magnum:
assignee: Hieu LE (hieulq) → rajiv (rajiv-kumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/353939

Changed in magnum:
assignee: rajiv (rajiv-kumar) → Spyros Trigazis (strigazi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/353951

Changed in magnum:
assignee: Spyros Trigazis (strigazi) → Hieu LE (hieulq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/354022

Changed in magnum:
assignee: Hieu LE (hieulq) → rajiv (rajiv-kumar)
Changed in magnum:
assignee: rajiv (rajiv-kumar) → Spyros Trigazis (strigazi)
Changed in magnum:
assignee: Spyros Trigazis (strigazi) → Hieu LE (hieulq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/353358
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=c0604fbdca5020f4f6642f2a63299db2aa50c027
Submitter: Jenkins
Branch: master

commit c0604fbdca5020f4f6642f2a63299db2aa50c027
Author: Hieu LE <email address hidden>
Date: Wed Aug 10 18:01:58 2016 +0700

    Improve unit test coverage for common/service.py

    Add new unit tests for common/service.py.
    Increase the coverage for common/service.py from 50 to 100%.

    Change-Id: I251d1541ae8088c47618fd0e11d81f44dc717aba
    Partial-Bug: #1511667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/354564

Changed in magnum:
assignee: Hieu LE (hieulq) → Spyros Trigazis (strigazi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/353839
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=1f18d9e17b203ee3c6bf3cb47321c81f6466e18c
Submitter: Jenkins
Branch: master

commit 1f18d9e17b203ee3c6bf3cb47321c81f6466e18c
Author: Hieu LE <email address hidden>
Date: Thu Aug 11 12:08:41 2016 +0700

    Improve unit test coverage for cmd/api.py

    Add new unit tests for cmd/api.py.
    Increase the coverage for cmd/api.py from 0 to 100%.

    Change-Id: I2409ed9ff11b55ae761d4f0b5768f65ca1bec9e3
    Partial-Bug: #1511667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/354623

Changed in magnum:
assignee: Spyros Trigazis (strigazi) → rajiv (rajiv-kumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/353848
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=81771f60b00d605dfe1bc07f1af6660cd3c1e0f2
Submitter: Jenkins
Branch: master

commit 81771f60b00d605dfe1bc07f1af6660cd3c1e0f2
Author: Hieu LE <email address hidden>
Date: Thu Aug 11 14:21:44 2016 +0700

    Improve unit test coverage for cmd/conductor.py

    Add new unit tests for cmd/conductor.py.
    Increase the coverage for cmd/conductor.py from 0 to 100%.

    Change-Id: I0c65ee9bc161046bcbd2b0ef5a8faf2f50a0f43e
    Partial-Bug: #1511667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/354739

Changed in magnum:
assignee: rajiv (rajiv-kumar) → Hieu LE (hieulq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/354739
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=9fe81ba40553e5525c78fd5377d26551ce87aacf
Submitter: Jenkins
Branch: master

commit 9fe81ba40553e5525c78fd5377d26551ce87aacf
Author: Rajiv Kumar <email address hidden>
Date: Fri Aug 12 19:27:12 2016 +0530

    Increased UT of magnum/api/app.py

    Increased UT from 98% to 100% for magnum/api/app.py file.

    Change-Id: I552ad245804a9eba1309b1a179819533c84eba1c
    Partial-Bug: #1511667

Changed in magnum:
assignee: Hieu LE (hieulq) → rajiv (rajiv-kumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/353824
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=e2d320d103e19fe2a1fa973652fec72d35e3f883
Submitter: Jenkins
Branch: master

commit e2d320d103e19fe2a1fa973652fec72d35e3f883
Author: Rajiv Kumar <email address hidden>
Date: Thu Aug 11 09:08:32 2016 +0530

    Increase test coverage

    Test cases for expose.py has been added to increase coverage from
    86% to 100%.

    Two test cases has been added with "rest_content_types" as
    argument and without "rest_content_type".

    Change-Id: If757f31be1b314cdac9133133a8cac6614969e81
    Partial-Bug: #1511667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/354022
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=9d6045ce0bd582d90d9fbc6a3322b3edc028ab5d
Submitter: Jenkins
Branch: master

commit 9d6045ce0bd582d90d9fbc6a3322b3edc028ab5d
Author: Rajiv Kumar <email address hidden>
Date: Thu Aug 11 17:50:22 2016 +0530

    Increase in UT coverage

    Coverage is increased for magnum/conductor/utils.py from
    84% to 100%

    Change-Id: Id01708d0e15bcce0dc0945772f8be6d37195c336
    Partial-Bug: #1511667

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/353250
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=1f1a4c871a11048de40ea35bab37d65275e95363
Submitter: Jenkins
Branch: master

commit 1f1a4c871a11048de40ea35bab37d65275e95363
Author: Rajiv Kumar <email address hidden>
Date: Wed Aug 10 10:21:38 2016 +0530

    Increased test coverage

    Test coverage for attr_validation.py has been increased from 94%
    to 100%

    Change-Id: I7e43b5c31ef6d338933a2bf1b4728a323f4b95d7
    Partial-Bug: #1511667

Changed in magnum:
assignee: rajiv (rajiv-kumar) → Spyros Trigazis (strigazi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/353939
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=4d545d6751e92c876ebaec53cc8728fc3c87dfd8
Submitter: Jenkins
Branch: master

commit 4d545d6751e92c876ebaec53cc8728fc3c87dfd8
Author: Spyros Trigazis <email address hidden>
Date: Thu Aug 11 10:49:59 2016 +0200

    Compare test coverage with the master branch

    * checkout one commit before the latest and check coverage
    * check coverage with the latest commit
    * all new lines must be tested

    This functionallity essentially compares the current change
    with the master branch, since the coverage job runs always
    for only one change.

    Partial-Bug: #1511667
    Change-Id: I2ab9078489f30dbc383c068bb9abc0f3b9ee0e62

Changed in magnum:
assignee: Spyros Trigazis (strigazi) → Hieu LE (hieulq)
Changed in magnum:
assignee: Hieu LE (hieulq) → Spyros Trigazis (strigazi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/353951
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=99cfbcbc8bcdb69e75ebd39dc19273da6c64eae5
Submitter: Jenkins
Branch: master

commit 99cfbcbc8bcdb69e75ebd39dc19273da6c64eae5
Author: Hieu LE <email address hidden>
Date: Thu Aug 11 18:10:30 2016 +0700

    Make magnum manage_template read config file and increase coverage

    Currently magnum-manage-template command doesn't read config file
    properly. This patch make manage-template script read config file
    and display template list the right way.

    Add new unit tests for cmd/template_manage.py.
    Increase the coverage for cmd/template_manage.py from 0 to 100%.

    Change-Id: I3a4df33834201148f824ebe013c5a22aee3ec1f8
    Partial-Bug: #1511667
    Closes-Bug: #1612596

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/354564
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=85d4c68365eec102cbebfb2e098ad3fee310e775
Submitter: Jenkins
Branch: master

commit 85d4c68365eec102cbebfb2e098ad3fee310e775
Author: Hieu LE <email address hidden>
Date: Fri Aug 12 15:50:29 2016 +0700

    Improve unit test coverage for cmd/db_manage.py

    Add new unit tests for cmd/db_manage.py.
    Increase the coverage for cmd/db_manage.py from 0 to 100%.

    Move the subcommand 'command' of db_manage to out side
    of method main for easier testing.

    Change-Id: I686fbc25fd58aea91b5a862fc61c832f4e0d8684
    Partial-Bug: #1511667

Hieu LE (hieulq)
description: updated
Hieu LE (hieulq)
description: updated
Revision history for this message
Hieu LE (hieulq) wrote :

The coverage report is 90% now, I think we can close this bug.

description: updated
Hieu LE (hieulq)
Changed in magnum:
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on magnum (master)

Change abandoned by Adrian Otto (<email address hidden>) on branch: master
Review: https://review.openstack.org/354623
Reason: Marking as abandoned due to inactivity. You are welcome to un-abandon this and resubmit.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.