Skip to content

Commit

Permalink
Debug output for discover -h fmf --modified-only
Browse files Browse the repository at this point in the history
Add `modified_ref`,`HEAD` commit hash output
Print that nothing is selected
  • Loading branch information
lukaszachy authored and psss committed Mar 20, 2024
1 parent 630e95a commit b9864b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tmt/steps/discover/fmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ def assert_git_url(plan_name: Optional[str] = None) -> None:
'modified-ref',
tmt.utils.default_branch(repository=self.testdir, logger=self._logger))
self.info('modified-ref', modified_ref, 'green')
ref_commit = self.run(
Command('git', 'rev-parse', '--short', str(modified_ref)),
cwd=self.testdir)
assert ref_commit.stdout is not None
self.verbose('modified-ref hash', ref_commit.stdout.strip(), 'green')
output = self.run(
Command(
'git', 'log', '--format=', '--stat', '--name-only', f"{modified_ref}..HEAD"
Expand All @@ -566,6 +571,8 @@ def assert_git_url(plan_name: Optional[str] = None) -> None:
modified = {f"^/{re.escape(name)}" for name in directories if name}
self.debug(f"Limit to modified test dirs: {modified}", level=3)
names.extend(modified)
else:
self.debug(f"No modified directories between '{modified_ref}..HEAD' found.")

# Initialize the metadata tree, search for available tests
self.debug(f"Check metadata tree in '{tree_path}'.")
Expand Down

0 comments on commit b9864b2

Please sign in to comment.