feat: add TLS Certificates testing library (demo, do not merge)#331
feat: add TLS Certificates testing library (demo, do not merge)#331james-garner-canonical wants to merge 31 commits intocanonical:mainfrom
Conversation
Squashed commit of the following: commit ef90d9f Author: James Garner <[email protected]> Date: Tue Feb 3 14:25:25 2026 +1300 fix: correct type checking issues in tls-certificates lib
Squashed commit of the following: commit 1e85f9f95d17d84343389bc9eb19dac6117b193a Author: James Garner <[email protected]> Date: Thu Feb 5 21:54:54 2026 +1300 ci: install uv to run new script commit 7464d544aaa49b1d5115e97761c2d20d03c3337e Author: James Garner <[email protected]> Date: Thu Feb 5 21:50:52 2026 +1300 ci: add CI job and script to check testing versions match commit 44a42f0b7f4fa611513c233dc8ef7072cd4027a1 Author: James Garner <[email protected]> Date: Thu Feb 5 21:49:23 2026 +1300 ci: change approach to adding testing packages to ls.py output commit a2eb5ce9bc5473000735e34161855571c3b0a0e5 Author: James Garner <[email protected]> Date: Tue Feb 3 18:49:12 2026 +1300 ci: support testing packages in ls.py
d68722e to
60c51f1
Compare
Merge branch 'main' into 26-02+feat+tls-certficates-testing
| echo '${{ toJSON(needs) }}' | jq # logging | ||
| exit 1 | ||
|
|
||
| testing-versions-match: |
There was a problem hiding this comment.
Can this change be hoisted into own PR?
There was a problem hiding this comment.
This PR includes both an example of a library testing package, and the CI changes needed to support testing and releasing it (also proposed in the spec). They can be separated when either is ready to merge, but for now I think they should stay in one PR -- primarily so the tests for the testing package actually run, but also to show the CI changes required by the spec.
| if category == 'packages': | ||
| dirs.extend([t for p in dirs if _is_package(t := p / 'testing')]) |
There was a problem hiding this comment.
this change, if needed, should be in a separate PR
| @@ -0,0 +1,61 @@ | |||
| #!/usr/bin/env -S uv run --script --no-project | |||
There was a problem hiding this comment.
move out of the example PR used in the spec
| remote_units_data: dict[int, dict[str, str]] | ||
|
|
||
|
|
||
| def for_local_requirer( |
There was a problem hiding this comment.
Is the naming out of date wrt. spec, where names like relation_for_requirer are used?
There was a problem hiding this comment.
Good catch, thanks.
There was a problem hiding this comment.
github says that there are "white-space only changes" and doesn't show them.
Consider adding a sentence or two.
After all, this will be visible on PYPI.
There was a problem hiding this comment.
Yes, this is just an empty file to satisfy hatch at build time. We'd provide a real readme if we published this package.
| ctx = ops.testing.Context(provider_charm.ProviderCharm, meta=provider_charm.META) | ||
| relation = ops.testing.Relation("certificates", interface="tls-certificates") | ||
| state = ops.testing.State(relations=[relation]) |
There was a problem hiding this comment.
we seem to prefer this idiom in Ops docs:
import ops
from ops import testing
ctx = testing.Context(...)
relation = testing.Relation(...)
state testing.State(...)
There was a problem hiding this comment.
Well spotted, I used that approach in test_testing.py but not in test_*_charm.py for some reason.
No description provided.