Skip to content

fix: handle test series names with multiple dashes in fix_series#6

Open
xickomesquita wants to merge 1 commit intoElasticRun:masterfrom
xickomesquita:fix/test-series-name-parsing
Open

fix: handle test series names with multiple dashes in fix_series#6
xickomesquita wants to merge 1 commit intoElasticRun:masterfrom
xickomesquita:fix/test-series-name-parsing

Conversation

@xickomesquita
Copy link
Copy Markdown

Summary

  • fix_series() in run_test.py assumed series names had exactly one dash (e.g. TestData-7), extracting the number with split('-')[1]
  • When a name contained multiple dashes the split produced unexpected segments, raising ValueError and breaking the test runner series counter

Fix

Extract the numeric part from the last dash-separated segment instead of the second one, with a try/except fallback to 0 on any parse error:

parts = max_test_data_series[0].split('-')
if len(parts) > 1 and parts[-1].isdigit():
    max_test_data_series = int(parts[-1])
else:
    max_test_data_series = 0

Test plan

  • Run barista test suite with series names containing a single dash — behavior unchanged
  • Run with series names containing multiple dashes — no longer raises ValueError
  • Run with malformed series name — safely falls back to 0

The previous code assumed the series name had exactly one dash (e.g.
'TestData-7'). When the name contained more dashes (e.g. 'TestData-foo-7'),
`int(parts[0].split('-')[1])` raised a ValueError.

Now extracts the numeric part from the last segment, with a safe fallback
to 0 on any parse error.
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.

1 participant