Skip to content

Commit

Permalink
Use remote repo and fix a bug in regex matching of .fmf
Browse files Browse the repository at this point in the history
add release note
  • Loading branch information
Petr Matyas authored and happz committed Aug 7, 2024
1 parent 6c0bdfc commit f885db6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
3 changes: 3 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ support for :ref:`cpu.vendor-name</spec/hardware/cpu>` and
The linting of tests, plans and stories has been extended by detecting
duplicate ids.

Test directories pruning now works correctly for nested fmf trees
and there is also a test for it.

tmt-1.34
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 6 additions & 5 deletions tests/discover/prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ rlJournalStart
rlRun "run=\$(mktemp -d)"
rlPhaseEnd

rlPhaseStartTest "Discover only"
rlPhaseStartTest "Discover local"
rlRun -s "tmt run -i $run discover plans --name plan tests --name test1"
rlAssertExists "$run/plan/discover/default-0/tests/test1"
rlAssertNotExists "$run/plan/discover/default-0/tests/test2"
rlAssertNotExists "$run/plan/discover/default-0/tests/some-file"
rlPhaseEnd

rlPhaseStartTest "Discover only with path"
rlRun -s "tmt run -i $run discover plans --name nested tests --name test1"
rlAssertExists "$run/nested/discover/default-0/tests/test1"
rlAssertNotExists "$run/nested/discover/default-0/tests/test2"
rlPhaseStartTest "Discover remote with path"
rlRun -s "tmt run -i $run discover plans --name nested tests --name file"
rlAssertExists "$run/nested/discover/default-0/tests/file/test.sh"
rlAssertExists "$run/nested/discover/default-0/tests/scripts/random_file.sh"
rlAssertNotExists "$run/nested/discover/default-0/tests/dir-without-fmf"
rlPhaseEnd

rlPhaseStartCleanup
Expand Down
1 change: 1 addition & 0 deletions tests/discover/prune/nested.fmf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
discover:
how: fmf
url: https://github.com/teemtee/tests
path: nested
prune: true
provision:
Expand Down
1 change: 0 additions & 1 deletion tests/discover/prune/nested/.fmf/version

This file was deleted.

2 changes: 0 additions & 2 deletions tests/discover/prune/nested/test1/main.fmf

This file was deleted.

2 changes: 0 additions & 2 deletions tests/discover/prune/nested/test2/main.fmf

This file was deleted.

2 changes: 1 addition & 1 deletion tmt/steps/discover/fmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def do_the_discovery(self, path: Optional[Path] = None) -> None:
if prune:
# Save fmf metadata
clonedir = self.clone_dirpath / 'tests'
for path in tmt.utils.filter_paths(tree_path, ['.fmf']):
for path in tmt.utils.filter_paths(tree_path, [r'\.fmf']):
shutil.copytree(
path,
clonedir / path.relative_to(tree_path),
Expand Down

0 comments on commit f885db6

Please sign in to comment.