/srv/irclogs.ubuntu.com/2020/07/28/#smooth-operator.txt

facubatistapower is back!13:48
facubatista¡Muy buenos días a todos!13:48
* facubatista got the power! https://www.youtube.com/watch?v=j1BNcSBApOU13:49
facubatistajam, hello! did you see alejdg question from yesterday?13:55
jamalejdg, I'd have to see how you are defining your pod spec, my guess is that you should be setting a single container pod spec, and that Juju would handle the 'count' portion. I'm not sure how you're trying to distinguish specifics for each unit14:12
jamthanks facubatista I had missed it.14:12
facubatistajam, my plan is to review all issues, delay current ones marked with milestone 0.3.0 to 0.4.0, except anything that we want to include this week14:14
facubatistajam, I'll check out your PR first, see if we can land it, and then maybe change build to use it, so we start including everything in the project?14:14
jamsgtm14:15
facubatistajam, travis is not happy with your branch...14:18
jamfacubatista, thanks for the heads up, looking14:22
jamlooks like a 3.5ism14:23
jampathlib.Path *sigh*14:23
facubatistayes, 3.514:26
facubatistajam, after you deal with that, let's have a HO to sync? just ping me, thanks!14:27
crodriguez__I've heard about harness being the new way to do unit tests with the ops framework. Is there any documentation out there about it ?14:36
facubatistacrodriguez__, don't think so, but maybe we can provide you with examples?14:39
crodriguez__facubatista, yeah, anything that could help14:49
ballotHello !14:50
facubatistahello ballot14:52
crodriguez__any link you could share facubatista ?15:04
facubatistacrodriguez__, 5'15:08
facubatistacrodriguez__, https://paste.ubuntu.com/p/67Hcd5yPT3/15:21
facubatistajam, let me know if we can talk at some point today so I organize myself15:22
crodriguez__thank you facubatista15:37
alejdgjam:  How would I set specific secrets for each unit? Is there a way to do that?16:57
crodriguez_I don't understand harness... I thought it was supposed to mock the charm? But it looks like it is executing functions of the charm directly on my system instead. For example, I am testing harness.update_config , which triggers render_config in my charm. render_config, amongts other things, tries to create a directory in /etc/, which is denied because of lack of permissions18:59
facubatistacrodriguez_, we'll need help from jam for that :/20:14
crodriguez_facubatista, is he on PTO?20:18
facubatistacrodriguez_, nop, but we'll need to wait for tomorrow20:22
crodriguez_Ok facubatista, thanks for the info. I might schedule a meeting/work session for that20:30
facubatistacrodriguez_, nice20:32
vultaire2@crodriguez_: Re: your questions about operator framework - if you don't mind, I'm going to paraphrase a few of the questions here20:46
vultaire2I missed backscroll in this channel as I just joined20:47
vultaire2Your main question was: operator framework is supposed to mock the charm, thus why is it running stuff directly on your box?  ...Is that a fair way of rephrasing, or did I miss something?20:48
drewn3ss"For example, I am testing harness.update_config , which triggers render_config in my charm. render_config, amongts other things, tries to create a directory in /etc/, which is denied because of lack of permissions"20:48
crodriguez_pretty much yeah vultaire220:48
drewn3ssyeah, you've got it, vultaire220:48
* drewn3ss is wondering iif you still need to mock things like the render as we do in reactive unit tests20:49
* crodriguez_ wondering the same thing :)20:49
vultaire2Sorry for the delay here, jumping around a bit...20:51
vultaire2So, basically: it is mocking a lot of the stuff.  You could kind of say it lets you test functions of your charm code without juju running underneath it20:51
vultaire2that being said, it's not any sort of virtualization or anything like that, it's not spinning up containers or anything - all code _is_ running locally on your machine20:52
vultaire2with normal unit testing, you're typically running single functions directly on your development system, perhaps mocking out areas where the code does things you don't want it to (like talking to a DB, for example)20:53
vultaire2basically, with unit testing you're trying to test one function, or a small area of code, in isolation from the rest of the code20:53
vultaire2Now, this is normally pretty difficult with charms, especially pre-operator charms, as there's a lot of stuff running "under" them20:54
vultaire2all the juju binaries and such which get called behind the scenes20:54
vultaire2if you're just running unit tests and not doing a full end-to-end integration test, you typically don't want that, and thus you end up having to mock out stuff.  Lots of stuff.20:54
vultaire2With operator framework, a large amount of that is effectively mocked out for you20:55
vultaire2Just like with non-juju unit tests, your tests run on your machine.  So if your charm does things that you don't want modifying your system environment (like installing packages), you'll still need to mock those bits out20:56
vultaire2...Let me stop here.  Does this make sense somewhat?20:57
drewn3ssso, harness isn't providing a mocked virtual environment in total, but rather mocking out the juju layer in general?20:57
crodriguez_ok, thanks for the explanation. Yes that makes sense, I'll need to mock out some functions so it doesn't mess up my system haha..20:57
vultaire2yes20:57
crodriguez_your video is helpful too with the examples!20:57
crodriguez_I'll give it another shot and might ask more precise questions when I hit blockers20:58
drewn3sscrodriguez_: you might look to the unit tests I was just poking at for mock_render  https://git.launchpad.net/charm-prometheus-ceph-exporter/tree/tests/unit/test_reactive_ceph_exporter.py#n9520:58
vultaire2Sounds good, please do and best of luck20:58
drewn3ssit's not operator, but maybe some of that code will help you mock the render20:59
crodriguez_thanks drewn3ss!21:00
facubatistavultaire, drewn3ss, thanks!21:06
* facubatista eods21:19

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!