Ejemplo n.º 1
0
    from scripts.core.base import Printer
    parser.on_parse += Printer.setup_printer

    # import os
    # Paths.init(os.getcwd())

    # run work
    with Timer.app_timer:
        BinExecutor.register_sigint()
        returncode = do_work(parser)

    # collect artifact if not set otherwise
    # parser.parse()
    if parser.simple_options.artifacts:
        if parser.simple_options.artifacts is True:
            artifact_yml = Paths.artifact_yaml()
        else:
            artifact_yml = parser.simple_options.artifacts

        try:
            ap = ArtifactProcessor(artifact_yml)
            ap.run()
        except Exception as e:
            # we catch all error coming from artifact system
            # so it does not affect regular tests
            pass

    if type(returncode) is int:
        sys.exit(returncode)
    else:
        sys.exit(returncode.returncode)