Package: minimo
minimois a lightweight automation framework. mainly focuses on
automated test/task. the project name comes from the mini robot M-O in
WALL-E as the following guy:using minimo, you can create some standardized project instances bymmo initcommand. it will generate project with the organized
folders like:project-root-folder-with-project-name
    |- bin # minimo reserved command, don't touch it
    |- cases # suite and cases here
    |- ext # customized extensions, will be loaded before running commands
    |- lib # customized library, put all your common code here
        |- app.py
        |- performer.py
    |- log
    |- templates # case template
    |- vendor # vendor library
    |- .dockerignore
    |- .gitignore
    |- config.yml # global configuration
    |- Dockerfile # dockerfile if you want to run scheduler in docker
    |- README.md
    |- requirements.txt # dependencies here, use ``pip install -r requirements.txt`` to install all dependenciesafter project created, under the project root path you can use minimo
commands to create suite/cases bymmo new, or run suite/cases bymmo run.minimo will create new cases from the case template which is undertemplatesfolder. you can customize the template. you can also
customize template for each suite if you createtemplatesfolder
under the suite root path.currently minimo can run suite/cases in two types, which areserialandconcorrence, they are easy to understand from their names. and
they can be configured inconfig.yml.inconcorrencemode, suite/cases will be run by multi-thread pool,
thread count can be configured bymax_thread_count.the output can be configured too,
currently supportstext,htmlorxml.tip: we can usemmoorminimoas the main command after v0.4.0,
but in older version, it’s onlyminimo.Usagewe can use minimo by typing command in console, or calling its apis in
your own project.Installation$ pip install -U minimoCreate project instancecli$ mmo init [project-name] [-t template-path] [-o output-path]the project will be created underoutput-path, default is the current
working directory if nooutput-pathspecified. minimo will initialize
the project with default template. or you can specify a path which contains
the template.apiimportminimommo=minimo.Application(interface="api",root_path="/path/to/project/instance")# return True or False for `init` resultresult=mmo.call("init",name="helloKitty",template="/path/to/my/template",output="./myprojects")Create new casescli$ mmo new [cases...] [-a author]for example:$ mmo new suite1/case1 suite2/case2 case3 [-a hellokitty]minimo will walk through the sub-directory of task suite, if templates
exists in task suite, it initializes the case by the suite specified
templates, otherwise, by the project default templates.if specified author name, it will be filled in the template file, or
minimo will get the current system user as the author name.apiimportminimommo=minimo.Application(interface="api",root_path="path/to/instance_project")# return successfully created cases listcases=mmo.call("new",cases=["case1","suite2/case1","suite2/case2"])template file is written in mako’s syntax, check outmako.List all standard casescli$ mmo ls [pattern...]“pattern” supports Unix shell-style wildcards, such as * or ?. if not
specified “pattern”, it will list all standard cases’ names under
“cases” folder. if specified “pattern”, it will search the case name by
“pattern”. can give multiple patterns, such as：$ mmo ls foo bar*apiimportminimommo=minimo.Application(interface="api",root_path="path/to/instance_project")# return sorted valid casessorted_cases=mmo.call("ls")Run suitecli$ mmo run [case...]can specify some cases separated by whitespace as:$ mmo run case1 case2 case3and also can specify some suites (case group under one folder) as:$ mmo run suite1 suite2 suite3minimo will run all cases under those suites.apiimportminimommo=minimo.Application(interface="api",root_path="path/to/instance_project")# return output file path or None if all failedsorted_cases=mmo.call("run",cases=["suite1","suite2/case1","suite2/case2"])Get help$ mmo --help
$ mmo [command] --helpseems not useful in api modeGet versioncli$ mmo versionapiimportminimommo=minimo.Application(interface="api",root_path="path/to/instance_project")# version stringversion=mmo.call("version")Scheduled jobswe can run scheduled jobs in minimo project since r0.8, that is based on
APScheduler. just configure yourscheduleritem inconfig.yml, minimo
will execute your scheduled jobs in blocking mode, which means run in
foreground, recommend you to run your project in a docker container. detail
information about scheduler setting please refer toAPScheduler.cli$ mmo startapiimportminimommo=minimo.Application(interface="api",root_path="path/to/instance_project")mmo.call("start")please note that scheduler configured in case/config.yml will not work.