Skip to content

test: add conformance tests for the tracing and certificate_transfer interfaces - #2711

Open
tonyandrewmeyer wants to merge 1 commit into
canonical:mainfrom
tonyandrewmeyer:tracing-conformance-tests
Open

test: add conformance tests for the tracing and certificate_transfer interfaces#2711
tonyandrewmeyer wants to merge 1 commit into
canonical:mainfrom
tonyandrewmeyer:tracing-conformance-tests

Conversation

@tonyandrewmeyer

Copy link
Copy Markdown
Collaborator

The requirer-side behaviour of ops_tracing is currently pinned only indirectly, through test_api.py and the vendored charm libs' own assumptions. These tests read the tracing v2 and certificate_transfer v1 interface reference pages and assert the documented clauses against Tracing, driven through ops.testing, so that a change in the upstream contract forces a decision in our vendored use.

Each test names in its docstring the clause it covers. Nothing here touches ops_tracing itself.

These are extracted from #2557, which de-pydantic's the two vendored databag modules. Landing them first means that PR can show the same tests green before and after, rather than asking a reviewer to take the refactor on trust. Also, if we decide to not de-vendor in the way #2557 proposes, these tests still have value.

…interfaces

The requirer-side behaviour of `ops_tracing` is pinned only indirectly at
the moment, through `test_api.py` and the vendored charm libs' own
assumptions. These tests read the two interface reference pages and assert
the documented clauses against `Tracing`, driven through `ops.testing`, so
that a change in the upstream contract forces a deliberate decision rather
than showing up as a surprise later.

Each test names the clause it covers in its docstring. Nothing here touches
`ops_tracing` itself, and the tests pass against the vendored pydantic
models as they stand.

@james-garner-canonical james-garner-canonical left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't read every test thoroughly, but I'm a big fan of this idea.

My only concern is that we don't have a good way to track if upstream behaviour definitions change, but that shouldn't block these tests being added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants