Skip to content

Commit 3faee62

Browse files
committed
Tests(refactor): Mirror the lgtm tests under tests/scripts
Both cover `scripts/lgtm/`, so they sit beside it. Their repository-root lookups count directories, and the counts move with them. The dashboard generator and the stack's README each pointed at the dashboard test by its old name, which is the pairing this layout now makes checkable from the path. With these, no branch in the stack carries a `scripts/bench_*` or a `tests/test_bench_*`: one convention, everywhere, rather than one that arrives partway up.
1 parent b265f31 commit 3faee62

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/lgtm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ changing the generator:
210210
$ just otel-dashboards
211211
```
212212

213-
`up.sh` regenerates on every start, and `tests/test_lgtm_dashboards.py` fails if
213+
`up.sh` regenerates on every start, and `tests/scripts/lgtm/test_dashboards.py` fails if
214214
the committed JSON differs from what the generator produces, so the two cannot
215215
diverge quietly. Editing a board in the Grafana UI is fine for exploring; move
216216
the change into the generator to keep it.

scripts/lgtm/generate_dashboards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
list of panel calls and :class:`Board` does the grid math.
77
88
The generated JSON is committed. ``scripts/lgtm/up.sh`` regenerates it on every
9-
start and ``tests/test_lgtm_dashboards.py`` fails if the committed copy differs,
9+
start and ``tests/scripts/lgtm/test_dashboards.py`` fails if the committed copy differs,
1010
so the two cannot silently diverge.
1111
1212
Every panel must be backed by telemetry ``scripts/lgtm/smoke.py`` actually

tests/scripts/lgtm/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Tests for scripts/lgtm/."""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import pytest
2020

21-
_ROOT = pathlib.Path(__file__).parents[1]
21+
_ROOT = pathlib.Path(__file__).parents[3]
2222
_LGTM = _ROOT / "scripts" / "lgtm"
2323
_DASHBOARDS = _LGTM / "dashboards"
2424

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import pytest
2222

23-
_ROOT = pathlib.Path(__file__).parents[1]
23+
_ROOT = pathlib.Path(__file__).parents[3]
2424

2525

2626
_PREAMBLE = (

0 commit comments

Comments
 (0)