Skip to content

Commit 41cfd61

Browse files
authored
Merge pull request #447 from jernst/develop
Allow default testsdir to be overridden
2 parents eecda7c + fe6e614 commit 41cfd61

File tree

6 files changed

+8
-5
lines changed

6 files changed

+8
-5
lines changed

src/feditest/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def load_tests_from(dirs: list[str]) -> None:
4747
"""
4848
Load all tests found in the provided directories. This is broken into two steps for easier testing.
4949
"""
50+
if not dirs:
51+
dirs = ['tests']
52+
5053
_load_tests_pass1(dirs)
5154
_load_tests_pass2()
5255

src/feditest/cli/commands/create_session_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
3838
"""
3939
# general flags and options
4040
parser = parent_parser.add_parser(cmd_name, help='Create a template for a test session')
41-
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
41+
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
4242

4343
# session template options
4444
parser.add_argument('--name', default=None, required=False, help='Name of the created test session template')

src/feditest/cli/commands/create_testplan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
3838
"""
3939
# general flags and options
4040
parser = parent_parser.add_parser(cmd_name, help='Create a test plan by running all provided test sessions in all provided constellations')
41-
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
41+
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
4242

4343
# test plan options
4444
parser.add_argument('--name', default=None, required=False, help='Name of the generated test plan')

src/feditest/cli/commands/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
9999
cmd_name: name of this command
100100
"""
101101
parser = parent_parser.add_parser( cmd_name, help='Provide information on a variety of objects')
102-
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
102+
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
103103
parser.add_argument('--nodedriversdir', action='append', help='Directory or directories where to find extra drivers for nodes that can be tested')
104104
type_group = parser.add_mutually_exclusive_group(required=True)
105105
type_group.add_argument('--test', help='Provide information about a test.')

src/feditest/cli/commands/list_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
3434
"""
3535
parser = parent_parser.add_parser(cmd_name, help='List the available tests')
3636
parser.add_argument('--filter-regex', default=None, help='Only list tests whose name matches this regular expression')
37-
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
37+
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
3838

3939
return parser

src/feditest/cli/commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
9797
"""
9898
# general flags and options
9999
parser = parent_parser.add_parser(cmd_name, help='Run one or more tests' )
100-
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
100+
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
101101
parser.add_argument('--nodedriversdir', action='append', help='Directory or directories where to find extra drivers for nodes that can be tested')
102102
parser.add_argument('--domain', type=hostname_validate, help='Local-only DNS domain for the DNS hostnames that are auto-generated for nodes')
103103
parser.add_argument('-i', '--interactive', action="store_true", help="Run the tests interactively")

0 commit comments

Comments
 (0)