Skip to content

Commit 112e3d8

Browse files
authored
Merge pull request #476 from radish-bdd/bugfix/change-default-marker-to-uuid
Change default marker to UUIDv4
2 parents 5c4aa19 + 842c17a commit 112e3d8

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1111
### Changes
1212
- Drop Python 3.6 and Python 3.7
1313
- Drop the `--profile` option, please use `--user-data`
14+
- Change default marker from unix timestamp to UUIDv4
1415

1516
## [v0.17.1]
1617

docs/commandline.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ Run - Use custom marker to uniquely identify test run
101101
-----------------------------------------------------
102102

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

108108
The marker is also displayed in the summary of a test run:

radish/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import os
44
import sys
5+
import uuid
56
import warnings
6-
from time import time
77

88
from docopt import docopt
99
import colorful
@@ -66,8 +66,8 @@ def run_features(core):
6666
merge_steps(core.features, StepRegistry().steps)
6767

6868
# run parsed features
69-
if world.config.marker == "time.time()":
70-
world.config.marker = int(time())
69+
if world.config.marker == "str(uuid.uuid4())":
70+
world.config.marker = str(uuid.uuid4())
7171

7272
# scenario choice
7373
amount_of_scenarios = sum(len(f.scenarios) for f in core.features_to_run)
@@ -123,7 +123,7 @@ def main(args=None):
123123
-e --early-exit stop the run after the first failed step
124124
--debug-steps debugs each step
125125
-t --with-traceback show the Exception traceback when a step fails
126-
-m=<marker> --marker=<marker> specify the marker for this run [default: time.time()]
126+
-m=<marker> --marker=<marker> specify the marker for this run [default: str(uuid.uuid4())]
127127
-b=<basedir> --basedir=<basedir>... set base dir from where the step.py and terrain.py will be loaded. [default: $PWD/radish]
128128
You can specify -b|--basedir multiple times or split multiple paths with a colon (:) similar to $PATH. All files will be imported.
129129
-d --dry-run make dry run for the given feature files

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""
1111

1212
import os
13+
import uuid
1314

1415
import pytest
1516

@@ -55,7 +56,7 @@ def mock_world_config():
5556
"--inspect-after-failure": False,
5657
"--junit-xml": None,
5758
"--junit-relaxed": False,
58-
"--marker": "time.time()",
59+
"--marker": "str(uuid.uuid4())",
5960
"--no-ansi": False,
6061
"--no-line-jump": False,
6162
"--scenarios": None,

0 commit comments

Comments
 (0)