Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(reporting): replace scenario_info.id_hash with uuid for an edge case bug on expand / collapse #171

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions behavex/outputs/report_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from behavex.outputs.report_utils import (get_environment_details,
get_error_message,
match_for_execution, text)
from behavex.utils import (generate_hash, get_scenario_tags,
from behavex.utils import (generate_hash, generate_uuid, get_scenario_tags,
try_operate_descriptor)


Expand Down Expand Up @@ -181,8 +181,7 @@ def _processing_scenarios(scenarios, scenario_list, id_feature):
scenario_info['error_lines'] = error_lines
scenario_info['error_step'] = error_step
scenario_info['error_background'] = error_background
scenario_info['id_hash'] = generate_hash("{}:{}".format(scenario.filename,
scenario.line))
scenario_info['id_hash'] = generate_uuid()
if scenario.feature.name in global_vars.retried_scenarios:
if (
scenario.name
Expand Down
4 changes: 4 additions & 0 deletions behavex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import shutil
import sys
import time
import uuid
from functools import reduce
from tempfile import gettempdir

Expand Down Expand Up @@ -583,3 +584,6 @@ def generate_hash(word):
hash_int = int.from_bytes(truncated_hash, byteorder='big')
# Ensure the result fits in 48 bits (optional, for consistency)
return hash_int & 0xFFFFFFFFFFFF

def generate_uuid():
return uuid.uuid4().hex
Loading