docs: add COS Lite integration tests to K8s tutorial#2478
Conversation
There was a problem hiding this comment.
The docs changes look good to me. Thank you.
I agree with letting the users know about overriding the timeout period.
There might be an issue that makes the test timeout, and increasing the period doesn't help. In such case, the reader should debug their tests or look for help. This could be a small "note" or "warning" at the end. I'm not sure whether we should include it, as it's hard to know how long is too long.
Yeah, I think it's hard to give general advice. But I like your thinking. I've updated the advice slightly:
|
This is perfect. Thanks! |
james-garner-canonical
left a comment
There was a problem hiding this comment.
Looks good to me, thanks @dwilding. My main suggestion is that we add @pytest.mark.juju_setup to the deploy and integrate tests (should add them to the examples too in this PR if so).
| Add two test functions to `tests/integration/test_charm.py`: | ||
|
|
||
| ```python | ||
| def test_deploy_cos(cos: jubilant.Juju): |
There was a problem hiding this comment.
Presumably we'd want this.
| def test_deploy_cos(cos: jubilant.Juju): | |
| @pytest.mark.juju_setup | |
| def test_deploy_cos(cos: jubilant.Juju): |
And I guess we want it on the integrate test as well.
Again, something I should have noticed in the previous PR.
There was a problem hiding this comment.
Pretty sure you did notice it in the previous PR. I deferred doing it there because I want to get @pytest.mark.juju_setup into the profiles first. I'm going to use the same excuse here 🙂 When canonical/charmcraft#2695 merges, I'll open an Ops PR to add @pytest.mark.juju_setup to the tutorials and example charms.
This PR follows on from #2411 and resolves #1838.
I'm adding a new section Write integration tests (preview) to the last chapter of the K8s tutorial. The tests in this section match what was added to the example charm in the previous PR.
Other changes:
Adjusted the part where we talk about adding
coslto dependencies. It wasn't clear why 1.9.1 should be added based on the versions required by libs, so I'm explicitly saying to add the latest version of the package. PreviewDuring earlier testing, I found that the postgres deployment can cause the integration tests to time out. We don't want to specify a timeout in that test, so I've added some info to the tutorial chapter (Preview):