canonical / hardware-observer-operator

A charm to setup prometheus exporter for IPMI, RedFish and RAID devices from different vendors.
Apache License 2.0
7 stars 14 forks source link

Fix typing issue #234

Closed chanchiwai-ray closed 2 months ago

chanchiwai-ray commented 2 months ago

After operator framework fixes the incorrect types in model.config [1], it introduces some issues in our existing codebases since we used to assume them to have type of str which is not correct in the first place.

[1] https://github.com/canonical/operator/pull/1183

rgildein commented 2 months ago

Strangely, this change is not covered by the unit tests. I thought if we make this change, we also need to change the unit tests.

chanchiwai-ray commented 2 months ago

Strangely, this change is not covered by the unit tests. I thought if we make this change, we also need to change the unit tests.

This is only typing an issue; operator framework just released that corrected the types yesterday

rgildein commented 2 months ago

There is not unit test for _on_install_or_upgrade, it does not matter if it's just type. The self.model.config should be mocked with returning something not as string, and then we should have a test checking that self.exporter.install was called with some parameters.