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

convert ansi colour sequences to coloured span tags #272

Merged
merged 1 commit into from Feb 4, 2015
Merged

convert ansi colour sequences to coloured span tags #272

merged 1 commit into from Feb 4, 2015

Conversation

ulfurinn
Copy link
Contributor

Some testing packages (such as goconvey itself) will colour the output with ANSI escape sequences; the web view will display them as, for example, "[32m✔[0m", which gets noisy very quickly. This patch converts them to span tags with colour classes.

This is based on https://github.com/mmalecki/ansispan

@mholt
Copy link
Contributor

mholt commented Nov 14, 2014

Cool, thanks! I'll take a look at this soon. Pretty in over my head right now with things...

@mdwhatcott
Copy link
Collaborator

@ulfurinn - I just encountered this kind of output for the first time. Can you share some of your code that produces the output for you?

For me, it happened because I was writing a test from outside the package under test. For example, if the package I was testing was github.com/smartystreets/blah the package I declared in my test files was github.com/smartystreets/blah_test. This caused the goconvey server to NOT use the -json field becuase go list -f '{{.TestImports}}' no longer found the goconvey package in the imports list. I had no idea this could happen and I'm wondering if this is what you are encountering.

@ulfurinn
Copy link
Contributor Author

This is indeed the case. bitbucket.org/ulfurinn/options is one example.

If package detection is fixed, could this patch still be useful for running tests using other frameworks that produce coloured output?

@mdwhatcott
Copy link
Collaborator

Yes, it still could be useful--thanks for contributing.

@mdwhatcott
Copy link
Collaborator

Thanks for confirming my suspicions @ulfurinn. I'm glad to finally know the cause.

mdwhatcott added a commit that referenced this pull request Feb 4, 2015
convert ansi colour sequences to coloured span tags
@mdwhatcott mdwhatcott merged commit e39b623 into smartystreets:master Feb 4, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants