Skip to content

Feat/12109 custom name v3 - #40

Open
Davihan11 wants to merge 1 commit into
CESNET:mainfrom
Davihan11:feat/12109-custom-label-v3
Open

Feat/12109 custom name v3#40
Davihan11 wants to merge 1 commit into
CESNET:mainfrom
Davihan11:feat/12109-custom-label-v3

Conversation

@Davihan11

Copy link
Copy Markdown
Collaborator

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).

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).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-label pytest option and integrates it into run directory creation and per-test result paths.
  • Adds -rl/--run-label passthrough support in pytest_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.

Comment thread conftest.py
if not _label:
return TIME_STR

if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._-]*", _label):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@Davihan11 Davihan11 self-assigned this Aug 11, 2026
@Davihan11 Davihan11 added the enhancement New feature or request label Aug 11, 2026
Comment thread conftest.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants