Skip to content

Commit

Permalink
Merge pull request #476 from radish-bdd/bugfix/change-default-marker-…
Browse files Browse the repository at this point in the history
…to-uuid

Change default marker to UUIDv4
  • Loading branch information
fliiiix authored Dec 19, 2024
2 parents 5c4aa19 + 842c17a commit 112e3d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changes
- Drop Python 3.6 and Python 3.7
- Drop the `--profile` option, please use `--user-data`
- Change default marker from unix timestamp to UUIDv4

## [v0.17.1]

Expand Down
4 changes: 2 additions & 2 deletions docs/commandline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Run - Use custom marker to uniquely identify test run
-----------------------------------------------------

Radish supports marker functionality which is used to uniquely identify a
specific test run. By default the marker is set to the number of seconds from
the epoch (01/01/1970). You can specify your own marker using the ``-m`` or
specific test run. By default the marker is set to a random UUID Version 4.
You can specify your own marker using the ``-m`` or
``--marker`` command line option.

The marker is also displayed in the summary of a test run:
Expand Down
8 changes: 4 additions & 4 deletions radish/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import os
import sys
import uuid
import warnings
from time import time

from docopt import docopt
import colorful
Expand Down Expand Up @@ -66,8 +66,8 @@ def run_features(core):
merge_steps(core.features, StepRegistry().steps)

# run parsed features
if world.config.marker == "time.time()":
world.config.marker = int(time())
if world.config.marker == "str(uuid.uuid4())":
world.config.marker = str(uuid.uuid4())

# scenario choice
amount_of_scenarios = sum(len(f.scenarios) for f in core.features_to_run)
Expand Down Expand Up @@ -123,7 +123,7 @@ def main(args=None):
-e --early-exit stop the run after the first failed step
--debug-steps debugs each step
-t --with-traceback show the Exception traceback when a step fails
-m=<marker> --marker=<marker> specify the marker for this run [default: time.time()]
-m=<marker> --marker=<marker> specify the marker for this run [default: str(uuid.uuid4())]
-b=<basedir> --basedir=<basedir>... set base dir from where the step.py and terrain.py will be loaded. [default: $PWD/radish]
You can specify -b|--basedir multiple times or split multiple paths with a colon (:) similar to $PATH. All files will be imported.
-d --dry-run make dry run for the given feature files
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""

import os
import uuid

import pytest

Expand Down Expand Up @@ -55,7 +56,7 @@ def mock_world_config():
"--inspect-after-failure": False,
"--junit-xml": None,
"--junit-relaxed": False,
"--marker": "time.time()",
"--marker": "str(uuid.uuid4())",
"--no-ansi": False,
"--no-line-jump": False,
"--scenarios": None,
Expand Down

0 comments on commit 112e3d8

Please sign in to comment.