dilfridge | question | 00:13 |
---|---|---|
dilfridge | in a test in the distros subdir, can I use distros.uses_systemd() ? | 00:14 |
dilfridge | [working on implementing gentoo+systemd support, but the tested behaviour depends on that property] | 00:14 |
holmanb | dilfridge: hello | 00:23 |
holmanb | Um | 00:23 |
holmanb | How do you mean? | 00:24 |
holmanb | To change tested behavior at test runtime? | 00:24 |
holmanb | dilfridge: I'd suggest a separate distro implementation from the openrc one. Otherwise it's going to be a maze of if/else statements that will be annoying to touch. | 00:25 |
dilfridge | well, to be honest, I have no clue how the testsuite works, so I can't really answer the question | 00:28 |
dilfridge | and so far I have exactly two if/else, the rest is very generic | 00:28 |
holmanb | Ahh, okay if you have tox installed, just run `tox -e py3` | 00:28 |
holmanb | That will run all of the unit tests | 00:29 |
* dilfridge is not a particularly big python fan, sorry :] | 00:29 | |
holmanb | Or `tox -e py3-fast` if you want parallelism | 00:29 |
dilfridge | I think the common parts are much larger than the separate parts, especially if at some point more package manager stuff gets implemented | 00:30 |
dilfridge | most systemd things just worked out of the box immediately | 00:30 |
holmanb | Also want to make sure that the linters pass. `tox -e do_format` will autoformat your code. `tox -e ruff` will lint for errors of various types, and `tox -e mypy` will check for type errors | 00:31 |
dilfridge | ack, thank you | 00:31 |
dilfridge | it's late today, but tomorrow... | 00:31 |
holmanb | There are some others, but those typically cover a majority of the tests that should matter | 00:31 |
holmanb | Or just `tox` to run a bunch of them in serial, but that's a bit slower to iterate over | 00:32 |
holmanb | When developing | 00:32 |
dilfridge | [basic things work fine, tested with NoCloud] | 00:32 |
holmanb | Sounds good on the if/else, we can adjust later if needed | 00:33 |
holmanb | Cool :D | 00:33 |
=== Juesto is now known as Juest | ||
dilfridge | ok this is https://github.com/canonical/cloud-init/pull/5918 now | 12:35 |
-ubottu:#cloud-init- Pull 5918 in canonical/cloud-init "feat(gentoo): Add compatibility for Gentoo with systemd" [Open] | 12:35 | |
dilfridge | I *think* the unittest now only tests the systemd case, not the openrc case... but I wasn't sure how to implement that... one would just have to re-run the same test routines with a dist object that returns "not systemd" | 12:36 |
holmanb | andrewbogott: you can probably just mock the return value of uses_systemd | 16:17 |
holmanb | Oops wrong ping | 16:18 |
holmanb | dilfridge: ^^ | 16:18 |
dilfridge | hmm | 16:24 |
dilfridge | fixing the linter stuff now | 16:24 |
dilfridge | the integration test errors seem somewhat unrelated? | 16:41 |
dilfridge | > you can probably just mock the return value of uses_systemd | 18:39 |
dilfridge | pushed a solution based on this... also useful for future tests | 18:39 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!