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

Output to File #60

Closed
csalazar1 opened this issue May 8, 2021 · 5 comments
Closed

Output to File #60

csalazar1 opened this issue May 8, 2021 · 5 comments

Comments

@csalazar1
Copy link

Is there no way to output results to file? I didn't see any under the options listed

@jamie-sherriff
Copy link
Collaborator

Hey @csalazar1 Would love to know the use case? as the reporter is designed to send service messages to Teamcity which it expects on stdout of a build

But because the reporter output goes to stdout and stderr if enabled you could do an output pipe to a file with something like > output.txt or if you want both stdout and stderr > output.txt 2>&1

@DJ-Glock
Copy link
Contributor

@csalazar1 I can also recommend using | tee e2e.log. You can check my response here.

tee will duplicate output into the file without harming the original output that is parsed by TeamCity.

@csalazar1
Copy link
Author

Thank you for the response guys! The use case is actually for someone that wants to have multiple reporters. In this case, the first reporter would be outputting to STDOUT and the second reporter, mocha-teamcity, should be outputting to log file.

@DJ-Glock
Copy link
Contributor

DJ-Glock commented May 21, 2021

@csalazar1 in case if you want to have a several reporters, I would recommend you use https://github.com/stanleyhlng/mocha-multi-reporters. I had some experiments with this lib and another similar one, but found it much more useful. I think about using it even with one reporter because it allows to configure reporter options easier than several parameters in one line (i use CLI command for running tests).

I just faced one issue when was configuring mocha-teamcity-reporter in mocha-multi-reporters - passing boolean value to report parameter. If I remember correctly, boolean value should be double quoted, like this: "true" (for mocha-teamcity-reporter! I did not face such issues with other reporters).

Both reporters will output in the same place and should not hurt each other because you will use different reporters I believe.

@jamie-sherriff
Copy link
Collaborator

I have updated the readme with some of the highlights from this issue but if there is anything else to add please reopen with a comment.

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

3 participants