canonical / canonical/charmlibs

[OTLP] Improve testing the `add` methods for rules

Open Beginner friendly
#429 2 comments 0 reactions 0 assignees View on GitHub
charmlibs-interfaces-otlp team-observability-core tests
Dominant language
Python
Stars
5
Forks
28
Avg merge
1d 5h
Merged PRs (30d)
24

Description

In the OTLP lib we are not testing the add_promql_path (or logql) methods which wrap around the cos-lib Rules methods:
- https://github.com/canonical/cos-lib/blob/d71b94c3765bbe176b46a05a9bb3ce740272c6bb/src/cosl/rules.py#L485

We should provide some extra utests to assert that the minimal functionality that the wrapper provides is doing what it is supposed to. Specifically the effects on the RuleStore:
- promql
- logql

Contributor guide

Open the contributing guide

Research direction

Start with the OTLP wrapper methods add_promql_path and add_logql, then read the referenced cos-lib src/cosl/rules.py implementation around the Rules methods. Add unit tests that exercise each wrapper and verify its effects on the RuleStore for promql and logql.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.