Skip to content

Commit

Permalink
Merge pull request #447 from jernst/develop
Browse files Browse the repository at this point in the history
Allow default testsdir to be overridden
  • Loading branch information
jernst authored Dec 29, 2024
2 parents eecda7c + fe6e614 commit 41cfd61
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/feditest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def load_tests_from(dirs: list[str]) -> None:
"""
Load all tests found in the provided directories. This is broken into two steps for easier testing.
"""
if not dirs:
dirs = ['tests']

_load_tests_pass1(dirs)
_load_tests_pass2()

Expand Down
2 changes: 1 addition & 1 deletion src/feditest/cli/commands/create_session_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
"""
# general flags and options
parser = parent_parser.add_parser(cmd_name, help='Create a template for a test session')
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')

# session template options
parser.add_argument('--name', default=None, required=False, help='Name of the created test session template')
Expand Down
2 changes: 1 addition & 1 deletion src/feditest/cli/commands/create_testplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
"""
# general flags and options
parser = parent_parser.add_parser(cmd_name, help='Create a test plan by running all provided test sessions in all provided constellations')
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')

# test plan options
parser.add_argument('--name', default=None, required=False, help='Name of the generated test plan')
Expand Down
2 changes: 1 addition & 1 deletion src/feditest/cli/commands/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
cmd_name: name of this command
"""
parser = parent_parser.add_parser( cmd_name, help='Provide information on a variety of objects')
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
parser.add_argument('--nodedriversdir', action='append', help='Directory or directories where to find extra drivers for nodes that can be tested')
type_group = parser.add_mutually_exclusive_group(required=True)
type_group.add_argument('--test', help='Provide information about a test.')
Expand Down
2 changes: 1 addition & 1 deletion src/feditest/cli/commands/list_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
"""
parser = parent_parser.add_parser(cmd_name, help='List the available tests')
parser.add_argument('--filter-regex', default=None, help='Only list tests whose name matches this regular expression')
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')

return parser
2 changes: 1 addition & 1 deletion src/feditest/cli/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def add_sub_parser(parent_parser: _SubParsersAction, cmd_name: str) -> ArgumentP
"""
# general flags and options
parser = parent_parser.add_parser(cmd_name, help='Run one or more tests' )
parser.add_argument('--testsdir', action='append', default=['tests'], help='Directory or directories where to find tests')
parser.add_argument('--testsdir', action='append', help='Directory or directories where to find tests')
parser.add_argument('--nodedriversdir', action='append', help='Directory or directories where to find extra drivers for nodes that can be tested')
parser.add_argument('--domain', type=hostname_validate, help='Local-only DNS domain for the DNS hostnames that are auto-generated for nodes')
parser.add_argument('-i', '--interactive', action="store_true", help="Run the tests interactively")
Expand Down

0 comments on commit 41cfd61

Please sign in to comment.