Skip to content

Commit

Permalink
Merge branch 'trojanek/dontwalk' into 'master'
Browse files Browse the repository at this point in the history
Don't walk into internal VCS directories when looking for tests

See merge request it/e3-testsuite!15
  • Loading branch information
ptroja committed Nov 17, 2023
2 parents b257181 + 4527bdf commit acb2992
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* Include total testsuite and testcase durations in XUnit reports.
* Add support for `--xunit-output` in `e3-testsuite-report`.
* Add support for `--failure-exit-code` in `e3-testsuite-report`.
* Ignore VCS directories like .git when looking for tests.

25.0 (2022-08-31)
=================
Expand Down
7 changes: 7 additions & 0 deletions src/e3/testsuite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,13 @@ def helper(spec: str) -> None:
for dirpath, dirnames, filenames in os.walk(
root, followlinks=True
):
# Don't descend into internal VCS directories, because it will
# likely generate a lot of unnecessary I/O operations and we
# don't expect to find any tests there anyway.
for vcsdir in ['.git', '.svn', 'CVS']:
if vcsdir in dirnames:
dirnames.remove(vcsdir)

# If all tests are guaranteed to have a dedicated directory,
# do not process directories that don't match the requested
# pattern.
Expand Down
1 change: 1 addition & 0 deletions tests/tests/simple-tests/CVS/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
description: Test inside VCS directory

0 comments on commit acb2992

Please sign in to comment.