missing coverage of charm events

Bug #1888641 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charm-k8s-jenkins-agent
Fix Released
Medium
Unassigned

Bug Description

https://git.launchpad.net/charm-k8s-jenkins-agent/tree/tests/unit/test_charm.py

has no test coverage for what happens if a user changes config.

You could do that testing with the operator framework's testing harness along the lines of:

from ops import testing

harness = testing.Harness(JenkinsAgentCharm)
harness.begin()
harness.update_config({'config_key': 'new_value'})

and then introspect attributes of 'harness.charm' to see if config changed was properly handled.

Note there is an open Operator issue for cleaner testing support of pod-spec-set:
https://github.com/canonical/operator/issues/261

If there is something that you would like to see that would make testing of charm behavior clear and clean for you, please leave comments on that issue.

Tom Haddon (mthaddon)
Changed in charm-k8s-jenkins-agent:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Tom Haddon (mthaddon) wrote :

We've since updated tests for this charm, and currently have 100% unit test coverage.

Changed in charm-k8s-jenkins-agent:
status: Confirmed → Fix Released
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.