交互式命令行助手
nift的Python项目详细描述
一个用于高效管理和 执行按层次结构分组的命令。
示例
假设您正在处理一个跨越多个 组件并接触代码库中的许多文件。在 发展过程中你必须不断地改变 文件和组件,以及每个更改都可能影响整个项目。
以确保您的更改不会破坏现有的 系统的行为,不管大小,你 必须连续运行单元测试和集成测试。
然而,管理和运行所有的测试并不总是那么简单 在复杂项目中的需要。有时你只想运行 一组测试,但偶尔需要运行大量测试 跨越项目的不同部分。而且,可能没有 提供给您足够灵活的测试脚本 有效地运行任何单独的测试或它们的组合。
好吧,别再绝望了,nifty就是为了解决这个问题而设计的。全部 您需要做的是在 对你有意义的层次结构。
下面是一个假设示例:
unittests:backend:-'base/utils/tests/utils_test.test'-'components/models/tests/models_test.test'-'servlet/v1/handlers/tests/handlers_test.test'logic:-'logic/core/encapsulation/tests/encapsulation_test.test'-'logic/core/request_delegation/tests/request_delegation.test'frontend:-'www/servlet/tests/servlet_test.test'-'rendering/tests/rendering_test.test'-'js/tests/js_test.test'integrations:-'v1/integrations/integration_test_1.test'-'v1/integrations/integration_test_2.test'-'v1/integrations/integration_test_3.test'
假设你把这个文件放在test_configs/project.yaml下,你所拥有的 要做的是用nifty运行这个: nifty test_configs/project.yaml -c testrunner -r'--verbose'
简言之,您传入配置文件的路径,在本例中 它是test_configs/project.yaml,然后是 用于运行测试,在本例中,它是一个假设的命令,名为 testrunner,紧跟在-c或--command之后。
此外,还可以指定传递给 命令后跟-r或--arguments(在本例中 是--verbose)。
注意:对于当前版本,只有最底层的项可以 列成单子。这是暂时设计的,威尔 以后可能会有更大的灵活性。
最后,如果你仍然感到迷茫,就做nifty --help。
项目选择
nifty允许您同时选择一个或多个项目。对于 上面的配置文件示例如下:
From config file: test_configs/project.yaml [1] unittests [1] logic [1] logic/core/encapsulation/tests/encapsulation_test.test [2] logic/core/request_delegation/tests/request_delegation.test [2] frontend [1] www/servlet/tests/servlet_test.test [2] rendering/tests/rendering_test.test [3] js/tests/js_test.test [3] backend [1] base/utils/tests/utils_test.test [2] components/models/tests/models_test.test [3] servlet/v1/handlers/tests/handlers_test.test [2] integrations [1] v1/integrations/integration_test_1.test [2] v1/integrations/integration_test_2.test [3] v1/integrations/integration_test_3.test Please enter: a) One or more paths (e.g. '1.2, 3.4.5') b) "all" c) "exit" >>
如果您只想选择一个项目,只需输入一个整数 标记为所需的项,交互式提示将跳入 那个项目。例如,如果要选择所有集成测试, 只要输入2,结果如下:
From config file: test_configs/project.yaml [1] v1/integrations/integration_test_1.test [2] v1/integrations/integration_test_2.test [3] v1/integrations/integration_test_3.test Please enter: a) One or more paths (e.g. '1.2, 3.4.5') b) "all" c) "exit" >>
您还可以选择一个或多个可能不在同一个项目中的项目 逻辑组,使用点分隔路径,每个路径用 逗号。例如,如果要选择js/tests/js_test.test, base/utils/tests/utils_test.test和 v1/integrations/integration_test_1.test一起输入 1.2.3, 1.3.1, 2.1。
结果如下:
Please enter: a) One or more paths (e.g. '1.2, 3.4.5') b) "all" c) "exit" >> 1.2.3, 1.3.1, 2.1 Going to execute the following 3 item(s) with the command testrunner: [1] js/tests/js_test.test [2] base/utils/tests/utils_test.test [3] v1/integrations/integration_test_1.test
最后,还有两个选项可以方便地 时间。-l或--list列出所有目标而不运行它们 并且-a或--all运行所有目标。
最新版本
1.6.3
许可证
做你他妈的想公开的许可证版本2,2004年12月
版权所有(c)2014 Yanzheng Li
每个人都可以复制和分发逐字或修改过的副本。 本许可证文件,并且只要名称 已更改。
做你他妈的想公开的许可条款和条件 复制、分发和修改
- 你他妈的想干什么就干什么。