Skip to content

Commit

Permalink
squash: add test, fix preserved files
Browse files Browse the repository at this point in the history
  • Loading branch information
happz committed Aug 15, 2024
1 parent 4427964 commit 4a17a03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/finish/basic/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ rlJournalStart
rlAssertNotExists "$tmp/cleanup-test"
rlPhaseEnd

rlPhaseStartTest "Verify prepare and finish step save results"
rlRun "tmt run -i $tmp --scratch provision prepare finish"
rlAssertExists "$tmp/prepare/results.yaml"
rlAssertEquals "Prepare results exists and it's empty" "$(cat $tmp/prepare/results.yaml)" "[]"
rlAssertExists "$tmp/finish/results.yaml"
rlAssertEquals "Finish results exists and it's empty" "$(cat $tmp/finish/results.yaml)" "[]"
rlPhaseEnd

rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Removing tmp directory"
Expand Down
4 changes: 4 additions & 0 deletions tmt/steps/finish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class Finish(tmt.steps.Step):

_plugin_base_class = FinishPlugin

_preserved_workdir_members = [
*tmt.steps.Step._preserved_workdir_members,
'results.yaml']

def wake(self) -> None:
""" Wake up the step (process workdir and command line) """
super().wake()
Expand Down
4 changes: 4 additions & 0 deletions tmt/steps/prepare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class Prepare(tmt.steps.Step):

_plugin_base_class = PreparePlugin

_preserved_workdir_members = [
*tmt.steps.Step._preserved_workdir_members,
'results.yaml']

def __init__(
self,
*,
Expand Down

0 comments on commit 4a17a03

Please sign in to comment.