You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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.
Activity
trans commentedon Jul 26, 2012
Do you want to write a new reporter, or do you just want to dump the output of an existing reporter to a file?
quad5 commentedon Jul 26, 2012
I just want to dump the output of an existing reporter to a file.
trans commentedon Jul 26, 2012
Try something like:
Google "stdout stderr redirection".
quad5 commentedon Jul 26, 2012
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).
trans commentedon Jul 27, 2012
Well, I suppose to do something like that, you'd have to look at the Turn code to see how you might override the
ioinstance 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.
quad5 commentedon Jul 27, 2012
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.
trans commentedon Jul 28, 2012
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.
trans commentedon Nov 25, 2012
You might be able to create a custom decorator to do this. This will be a new feature of the next release.