Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mytestopia committed Feb 8, 2024
1 parent 698d151 commit f05ca1c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions vedro_gitlab_reporter/_gitlab_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,17 @@ def on_arg_parse(self, event: ArgParseEvent) -> None:
type=str.upper,
help="Show the relative path of scenario in status (failed or passed). "
"--gitlab-show-paths - show all paths of scenarios; "
"--gitlab-show-paths=failed passed - show all paths of scenarios;"
"--gitlab-show-paths=failed - show all failed paths of scenarios;")
"--gitlab-show-paths failed passed - show all paths of scenarios;"
"--gitlab-show-paths failed - show all failed paths of scenarios;")

def on_arg_parsed(self, event: ArgParsedEvent) -> None:
self._collapsable_mode = event.args.gitlab_collapsable
self._tb_show_internal_calls = event.args.gitlab_tb_show_internal_calls
self._tb_show_locals = event.args.gitlab_tb_show_locals

if event.args.gitlab_show_paths == []:
# --gitlab-show-path -> gitlab_show_paths = [] -> all status
self._show_paths = [ScenarioStatus.FAILED, ScenarioStatus.PASSED]
else:
self._show_paths = event.args.gitlab_show_paths
# --gitlab-show-path -> default values (all)
self._show_paths = GitlabReporter.show_paths if event.args.gitlab_show_paths == [] \
else event.args.gitlab_show_paths

def on_startup(self, event: StartupEvent) -> None:
self._printer.print_header()
Expand Down Expand Up @@ -270,7 +268,7 @@ def _print_scope_val(self, val: Any) -> None:
self._printer.print_scope_val(val)

def _add_extra_details(self, scenario_result: ScenarioResult) -> None:
if self._show_paths and scenario_result.status in self._show_paths:
if self._show_paths and scenario_result.status.value in self._show_paths:
scenario_result.add_extra_details(f"{scenario_result.scenario.rel_path}")


Expand All @@ -287,4 +285,4 @@ class GitlabReporter(PluginConfig):
tb_max_frames: int = 8

# Show the relative path of scenario in status
show_paths: list = [ScenarioStatus.FAILED, ScenarioStatus.PASSED]
show_paths: list = [status.value for status in [ScenarioStatus.FAILED, ScenarioStatus.PASSED]]

0 comments on commit f05ca1c

Please sign in to comment.