autograder .cli .testing .generate-test-data
Generate test data by starting the specified server and running all tests in this project.
usage: python3 -m autograder.cli.testing.generate-test-data
[-h] [--version] [--testing-mode]
[--server-output-file SERVER_OUTPUT_PATH]
[--server-stop-command SERVER_STOP_COMMAND] [--startup-skip-identify]
[--startup-wait STARTUP_WAIT_SECS]
RUN_SERVER_COMMAND
Generate test data by starting the specified server and running all tests in this project.
positional arguments:
RUN_SERVER_COMMAND The command to run the LMS server that will be the
target of the data generation commands.
options:
-h, --help show this help message and exit
--version show program's version number and exit
testing options:
--testing-mode Run as if a test is being run (default: False).
server control:
--server-output-file SERVER_OUTPUT_PATH
Where server output will be written. Defaults to a
random temp file.
--server-stop-command SERVER_STOP_COMMAND
An optional command to stop the server. After this the
server will be sent a SIGINT and then a SIGKILL.
--startup-skip-identify
If set, startup will skip trying to identify the
server as a means of checking that the server is
started.
--startup-wait STARTUP_WAIT_SECS
The time to wait between starting the server and
sending commands (default: 10.0).
1# pylint: disable=invalid-name 2 3""" 4Generate test data by starting the specified server and running all tests in this project. 5""" 6 7import argparse 8import sys 9 10import edq.testing.serverrunner 11 12import autograder.cli.parser 13import autograder.testing.testdata 14 15def run_cli(args: argparse.Namespace) -> int: 16 """ Run the CLI. """ 17 18 return autograder.testing.testdata.generate(args) 19 20def main() -> int: 21 """ Get a parser, parse the args, and call run. """ 22 return run_cli(_get_parser().parse_args()) 23 24def _get_parser() -> argparse.ArgumentParser: 25 """ Get the parser. """ 26 27 parser = autograder.cli.parser.get_parser(__doc__.strip()) 28 edq.testing.serverrunner.modify_parser(parser) 29 30 return parser 31 32if (__name__ == '__main__'): 33 sys.exit(main())
def
run_cli(args: argparse.Namespace) -> int:
16def run_cli(args: argparse.Namespace) -> int: 17 """ Run the CLI. """ 18 19 return autograder.testing.testdata.generate(args)
Run the CLI.
def
main() -> int:
21def main() -> int: 22 """ Get a parser, parse the args, and call run. """ 23 return run_cli(_get_parser().parse_args())
Get a parser, parse the args, and call run.