Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDK should have an option to disable progress indicator to make it usable in CI #323

Closed
alvagante opened this issue Oct 13, 2017 · 7 comments

Comments

@alvagante
Copy link

alvagante commented Oct 13, 2017

The fancy rotating thing that is shown during pdk validate / test ( [|] [/] [-] ...] ) results in endless outputs when pdk is used in CI pipelines.
An option to disable it (or the whole removal of the fancy buy mostly useless progress indicator) would make pdk a first choice tool in CI.

@scotje
Copy link
Contributor

scotje commented Oct 13, 2017

Seems like a reasonable option. As a temporary measure, you can redirect STDERR to null if you want to suppress the progress output right now:

$ pdk validate --format=junit 2>/dev/null
error: task-metadata-lint: tasks/install.json: The property '#/description' of typeinteger did not match the following type: string

@bittner
Copy link

bittner commented Oct 27, 2017

Apart from the progress indicator, can we show some sensible output of validation and tests that are being executed? Just a normal test progress output, something like this (validate) and that (tests).

Is this something I can configure myself, or does it depend on PDK?

@DavidS
Copy link
Contributor

DavidS commented Oct 30, 2017

Some work for this has been captured in https://tickets.puppetlabs.com/browse/PDK-458 and https://tickets.puppetlabs.com/browse/PDK-643 .

@alvagante
Copy link
Author

Recent versions do the job. Closing.

@bittner
Copy link

bittner commented May 10, 2018

@alvagante Can you explain how this is done, and which those "recent versions" are?

I've just tried PDK v1.5.0, and I can't see how to disable the progress indicator.

$ pdk --version
1.5.0

No trace of appropriate options, e.g.

$ pdk validate --help
NAME
    validate - Run static analysis tests.

USAGE
    pdk validate [validators] [options] [targets]

DESCRIPTION
    Run metadata, Puppet, or Ruby validation.

    [validators] is an optional comma-separated list of validators to use. If
    not specified, all validators are used.

    [targets] is an optional space-separated list of files or directories to
    be validated. If not specified, validators are run against all applicable
    files in the module.

OPTIONS
    -a --auto-correct                Automatically correct problems where
                                     possible.
       --list                        List all available validators.
       --parallel                    Run validations in parallel.
       --pe-version=<value>          Puppet Enterprise version to run tests
                                     or validations against.
       --puppet-version=<value>      Puppet version to run tests or
                                     validations against.

OPTIONS FOR PDK
    -d --debug                       Enable debug output.
    -f --format=<value>              Specify desired output format. Valid
                                     formats are 'junit', 'text'. You may
                                     also specify a file to which the
                                     formatted output is sent, for example:
                                     '--format=junit:report.xml'. This option
                                     may be specified multiple times if each
                                     option specifies a distinct target file.
    -h --help                        Show help for this command.
       --version                     Show version of pdk.

😕

@bittner
Copy link

bittner commented May 10, 2018

Oh, the presence of an appropriate tty is detected automatically and the redirection can simply be omitted? Nice! 😃 👍

@scotje
Copy link
Contributor

scotje commented May 10, 2018

Yep! Sorry we should have linked this PR to this issue: #353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants