state: not all public methods are tested

Bug #1608494 reported by Roger Peppe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Won't Fix
Low
Unassigned

Bug Description

Having found that State.UpdateCloudCredentials will not replace existing
credentials as advertised (https://launchpad.net/bugs/1608421) I found
that that method has no tests.

Concerned by this, I ran the coverage tool on the state package and found the following
additional non-trivial methods and functions that are not tested at all:

 Application.ServiceAndUnitsStatus
 Charm.UpdateMacaroon
 ItemChange.String
 MacaroonCache.Get
 MacaroonCache.Set
 Machine.CancelAction
 Machine.CompletedActions
 Machine.InstanceStatusHistory
 Machine.OpenedPorts
 Machine.PendingActions
 Machine.RunningActions
 Machine.SetStopMongoUntilVersion
 Machine.StopMongoUntilVersion
 Machine.WatchActionNotifications
 Model.ConfigValues
 RestoreInfo.PurgeTxn
 State.FindEntity
 State.MongoVersion
 State.PutAuditEntryFn
 State.ResumeReplication
 StateSettings.ListSettings
 StateSettings.RemoveSettings
 State.SetUpgradeMongoMode
 State.UpdateCloudCredentials
 State.WatchActionResults
 State.WatchActionResultsFilteredBy
 State.WatchControllerStatusChanges
 Unit.AvailabilityZone

 SetSystemIdentity
 ParseBlockType
 IsCharmAlreadyUploadedError

I also saw the following non-public methods that seem to have substantial
non-trivial untested sections of logic:

 State.filesystemParamsWithDefaults
 openedPortsWatcher.initial
 State.constraintsValidator
 removeStorageAttachmentOps
 machineStoragePools

I think it's reasonable to expect that every public non-trivial function
and method should have at least one test.

Tags: unit-tests
Revision history for this message
Roger Peppe (rogpeppe) wrote :

A couple of other methods which seem to have test coverage only coincidentally, because they're called as part of a mostly-unrelated test that happens to call them:

     State.Cloud
     State.CloudCredentials

tags: added: unit-tests
Changed in juju-core:
status: New → Triaged
importance: Undecided → Low
milestone: none → 2.0.0
affects: juju-core → juju
Changed in juju:
milestone: 2.0.0 → none
milestone: none → 2.0.0
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.0.0 → 2.0.1
Curtis Hovey (sinzui)
Changed in juju:
milestone: 2.0.1 → none
Tim Penhey (thumper)
Changed in juju:
status: Triaged → Won't Fix
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.