Skip to content

Commit

Permalink
Fix Patch Steps (#886)
Browse files Browse the repository at this point in the history
Currently the Apply/Revert Patch steps always return OK, even if they failed.

Co-authored-by: Lukas Abelt <[email protected]>
  • Loading branch information
LuAbelt and Lukas Abelt authored May 16, 2024
1 parent 62cbd3a commit 2d62577
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions varats-core/varats/experiment/steps/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self, project: VProject, patch: Patch) -> None:
self.__patch = patch

def __call__(self) -> StepResult:
self.status = StepResult.OK
try:
print(
f"Applying {self.__patch.shortname} to "
Expand All @@ -31,9 +32,7 @@ def __call__(self) -> StepResult:
except ProcessExecutionError:
self.status = StepResult.ERROR

self.status = StepResult.OK

return StepResult.OK
return self.status

def __str__(self, indent: int = 0) -> str:
return textwrap.indent(
Expand All @@ -53,6 +52,7 @@ def __init__(self, project: VProject, patch: Patch) -> None:
self.__patch = patch

def __call__(self) -> StepResult:
self.status = StepResult.OK
try:
print(
f"Reverting {self.__patch.shortname} on "
Expand All @@ -65,9 +65,7 @@ def __call__(self) -> StepResult:
except ProcessExecutionError:
self.status = StepResult.ERROR

self.status = StepResult.OK

return StepResult.OK
return self.status

def __str__(self, indent: int = 0) -> str:
return textwrap.indent(
Expand Down

0 comments on commit 2d62577

Please sign in to comment.