Skip to content

fix(test): stop reusing the reserved "percentage" axis-label alias as incidental sample data - #368

Merged
shmsr merged 1 commit into
elastic:mainfrom
giorgi-imerlishvili-elastic:fix/ci-percentage-axis-title-test-collision
Aug 19, 2026
Merged

fix(test): stop reusing the reserved "percentage" axis-label alias as incidental sample data#368
shmsr merged 1 commit into
elastic:mainfrom
giorgi-imerlishvili-elastic:fix/ci-percentage-axis-title-test-collision

Conversation

@giorgi-imerlishvili-elastic

Copy link
Copy Markdown
Collaborator

Summary

main's Pytest CI is currently red (see e.g. #362 and #363, both failing Pytest (3.11/3.12/3.13) even though their own diffs are unrelated) because of a test-data collision from an already-merged same-day commit, not a new bug in any open PR.

4cb7726 (merged as part of #361) reserved the literal axis-label text "percentage" as an opaque Grafana-unit-id alias in _OPAQUE_AXIS_TITLE_ALIASES (observability_migration/targets/kibana/emit/display.py) — its title is now intentionally suppressed so a unit-inferred title like "%" can take over downstream instead of a redundant literal string. That commit added a correct, dedicated regression test for exactly this (test_extract_axis_label_suppresses_grafana_unit_id_aliases).

It did not touch a different, pre-existing, unrelated test — test_extract_xy_appearance_omits_line_area_style_for_bar — which happened to reuse the same literal string "percentage" purely as incidental sample text for testing something else entirely (that bar charts keep their axis config while correctly omitting line/area-only appearance keys like line_style/fill_opacity). That test started failing the moment the alias reservation landed, breaking main's own CI and, transitively, every open PR's CI (since PR checks run against a merge of the PR branch with current main).

Fix

Swap the incidental fixture text in test_extract_xy_appearance_omits_line_area_style_for_bar for an ordinary, non-reserved axis label ("CPU usage"), so it again exercises its own actual intent (bar-vs-area appearance keys) without colliding with the new opaque-alias behavior. No production code changes — confirmed via git grep that this was the only other test using "percentage"/"percent" as an axisLabel value.

Test plan

… incidental sample data

A same-day commit (4cb7726) reserved the literal axis-label text
"percentage" as an opaque Grafana-unit-id alias whose title is
intentionally suppressed (so unit-inferred titles like "%" can take over
instead) and added a correct, dedicated test for that behavior. It didn't
touch this unrelated, pre-existing test, which happened to reuse the same
literal string purely as incidental sample text for testing something
else entirely (that bar charts keep axis config while omitting
line/area-only appearance keys) -- breaking it on main and therefore on
every open PR whose CI merges against main.

Swap the incidental fixture text for an ordinary, non-reserved label so
the test again exercises its own actual intent without colliding with the
new opaque-alias behavior.
@shmsr
shmsr merged commit c7f3beb into elastic:main Aug 19, 2026
13 checks passed
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