Skip to content

Turn::Reporter.io output to a file #100

Open

Description

@quad5

Hello,

Can you please provide an example on how I can write Turn::Reporter to a file. I am executing test cases via ruby command.

ruby 1.9.3
minitest-3.2.0

Thanks

Activity

  1. trans commented on Jul 26, 2012

    @trans
    Member

    Do you want to write a new reporter, or do you just want to dump the output of an existing reporter to a file?

  2. quad5 commented on Jul 26, 2012

    @quad5
    Author

    I just want to dump the output of an existing reporter to a file.

  3. trans commented on Jul 26, 2012

    @trans
    Member

    Try something like:

    turn &> test-report.txt
    

    Google "stdout stderr redirection".

  4. quad5 commented on Jul 26, 2012

    @quad5
    Author

    Is this the only way to output to a file with Turn?

    I would prefer to create and write result file in my ruby scripts instead of using redirection because I want to control how much of the run result is saved to a file in case the result is too big for a file (due to too many errors' messages).

  5. trans commented on Jul 27, 2012

    @trans
    Member

    Well, I suppose to do something like that, you'd have to look at the Turn code to see how you might override the io instance in the minitest adapter, so that you can intercept the output and handle it as you wish. I'm sure it's possible, and probably not even very difficult, but it will take a little digging and figuring out. Afraid I am too busy to do it, but feel free and let me know what you figure out. I'd be glad to add instructions to wiki and/or accept any patches that might be needed to give it clean api for it.

    OTOH. I'm not sure your use case. But when I run into issues with too much error output I simply run one test script at a time as I work through them.

  6. quad5 commented on Jul 27, 2012

    @quad5
    Author

    Are you saying Reporter.io can't output to a file the way it is now?

    To ensure product stability, I want to loop test cases/runs over couple days.

  7. trans commented on Jul 28, 2012

    @trans
    Member

    No. I am saying you have to figure out how to set it up so that it is
    using a File IO. And given that you want to filter the output so it's
    not too big sounds like you have to create your own special IO
    subclass.

    Like I said it's probably not hard to do, I just have never done it,
    so I don't have an example for you.

    Would love to know what you come up with.

  8. trans commented on Nov 25, 2012

    @trans
    Member

    You might be able to create a custom decorator to do this. This will be a new feature of the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions