Skip to content

Specify cli root_dir as Path to avoid str / str operation - #21

Merged
olivialynn merged 3 commits into
mainfrom
olivia/specify-cli-root-as-path
Oct 14, 2026
Merged

olivialynn merged 3 commits into
mainfrom
olivia/specify-cli-root-as-path

Conversation

@olivialynn

@olivialynn olivialynn commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Passing --lbench-root crashes at startup with TypeError: unsupported operand type(s) for /: 'str' and 'str'

Currently:
We have 2 ways to set the root dir:

  • via CLI (doesn't work; interprets it as a string)
  • get_lbench_root_dir (works; parses it as a Path from LBENCH_ROOT env var)

In src/lbench/pytest/plugin.py, we call:

group.addoption("--lbench-root", action="store", default=None, ...)   # no type → value is a str
...
root = config.getoption("--lbench-root")      # e.g. "/some/dir"  (str)
if root is None:
    root = get_lbench_root_dir()              # Path; only this branch works
run_dir = root / run_id                       # str / str → TypeError

Proposed change:
Adding type=Path to the "--lbench-root" option
This lets us specify the root_dir via the cli, and still construct the run_dir path construction via the / operator.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 3.47%. Comparing base (a214c4a) to head (b9fc38b).

Files with missing lines Patch % Lines
src/lbench/pytest/plugin.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main     #21      +/-   ##
========================================
- Coverage   3.48%   3.47%   -0.01%     
========================================
  Files         26      26              
  Lines       1062    1064       +2     
========================================
  Hits          37      37              
- Misses      1025    1027       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@smcguire-cmu smcguire-cmu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@olivialynn
olivialynn merged commit 605bd6f into main Oct 14, 2026
6 of 9 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