[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 03/15] iotests/297: Add get_files() function
From: |
John Snow |
Subject: |
[PATCH v2 03/15] iotests/297: Add get_files() function |
Date: |
Tue, 19 Oct 2021 10:49:06 -0400 |
Split out file discovery into its own method to begin separating out
configuration/setup and test execution.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
---
tests/qemu-iotests/297 | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297
index b8101e6024a..15b54594c11 100755
--- a/tests/qemu-iotests/297
+++ b/tests/qemu-iotests/297
@@ -21,6 +21,7 @@ import re
import shutil
import subprocess
import sys
+from typing import List
import iotests
@@ -54,10 +55,14 @@ def is_python_file(filename):
return False
-def run_linters():
+def get_test_files() -> List[str]:
named_tests = [f'tests/{entry}' for entry in os.listdir('tests')]
check_tests = set(os.listdir('.') + named_tests) - set(SKIP_FILES)
- files = [filename for filename in check_tests if is_python_file(filename)]
+ return list(filter(is_python_file, check_tests))
+
+
+def run_linters():
+ files = get_test_files()
iotests.logger.debug('Files to be checked:')
iotests.logger.debug(', '.join(sorted(files)))
--
2.31.1
- [PATCH v2 00/15] python/iotests: Run iotest linters during Python CI, John Snow, 2021/10/19
- [PATCH v2 01/15] iotests/297: Move pylint config into pylintrc, John Snow, 2021/10/19
- [PATCH v2 03/15] iotests/297: Add get_files() function,
John Snow <=
- [PATCH v2 04/15] iotests/297: Create main() function, John Snow, 2021/10/19
- [PATCH v2 05/15] iotests/297: Don't rely on distro-specific linter binaries, John Snow, 2021/10/19
- [PATCH v2 02/15] iotests/297: Split mypy configuration out into mypy.ini, John Snow, 2021/10/19
- [PATCH v2 06/15] iotests/297: Split run_linters apart into run_pylint and run_mypy, John Snow, 2021/10/19
- [PATCH v2 07/15] iotests/297: refactor run_[mypy|pylint] as generic execution shim, John Snow, 2021/10/19
- [PATCH v2 09/15] iotests/297: update tool availability checks, John Snow, 2021/10/19
- [PATCH v2 10/15] iotests/297: split test into sub-cases, John Snow, 2021/10/19