Feat/12109 custom name v3 - #40
Open
Davihan11 wants to merge 1 commit into
Open
Conversation
Add the --run-label option to name the results directory instead of the
default timestamp (e.g. experimental-pr-1234-300s), with support in
pytest_start.sh (-rl/--run-label).
Validate the label with a single regex that rejects path separators and
labels starting with a dot, raising pytest.UsageError for a clean CLI
error instead of an internal ValueError.
Update README to reflect that results are saved under {run} (timestamp
or label).
There was a problem hiding this comment.
Pull request overview
Adds a user-defined run label to control the top-level results directory name (instead of always using the timestamp), with corresponding CLI/script and documentation updates.
Changes:
- Introduces
--run-labelpytest option and integrates it into run directory creation and per-test result paths. - Adds
-rl/--run-labelpassthrough support inpytest_start.sh. - Updates README to describe
{run}(timestamp or label) results/log locations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents {run} directory naming and the new --run-label option. |
| pytest_start.sh | Adds -rl/--run-label to forward a custom run label into pytest args. |
| conftest.py | Implements label validation and uses the label (or timestamp) to build artefacts paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if not _label: | ||
| return TIME_STR | ||
|
|
||
| if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._-]*", _label): |
Collaborator
Author
There was a problem hiding this comment.
Not that much relevent. This is issued to fix path traversal exploits, so the extra restriction is nice to have. I do not really think it hinders the user that much.
matyas7dub
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the --run-label option to name the results directory instead of the default timestamp (e.g. experimental-pr-1234-300s), with support in pytest_start.sh (-rl/--run-label).
Validate the label with a single regex that rejects path separators and labels starting with a dot, raising pytest.UsageError for a clean CLI error instead of an internal ValueError.
Update README to reflect that results are saved under {run} (timestamp or label).