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

Add browser log output to JUnit.xml #303

Closed
wants to merge 2 commits into from
Closed

Add browser log output to JUnit.xml #303

wants to merge 2 commits into from

Conversation

bitwiseman
Copy link
Contributor

Made the JUnit adapter inherit from base and push all log message into an array for output to the xml file.

@vojtajina
Copy link
Contributor

@bitwiseman
Copy link
Contributor Author

Okay, I've got the commit message guidelines now. Fixed.

@dignifiedquire
Copy link
Member

Great. While we're at it could you please add an e2e test that verifies that this is working as it's supposed to?

@bitwiseman
Copy link
Contributor Author

Good idea. Will do.

@bitwiseman
Copy link
Contributor Author

This update is better, it has an e2e test which runs but I'm a little vague on how to go about verifying the output. Anyone able to point me in the right direction?

@@ -32,6 +32,7 @@ var createReporters = function(names, config, emitter) {
var multiReporter = new MultiReporter();

names.forEach(function(name) {
log.debug('Loading reporter "%s"...', name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice but not really related to what you are doing or do I miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is how I figured out that the e2e tests weren't actually loading the junit reporter.

@dignifiedquire
Copy link
Member

I'm sorry, right now the e2e tests aren't configured to do output validation. It's the next thing on my todo list to setup a much better e2e testing environment. For now you can leave the e2e tests out, sorry for the confusion.

@bitwiseman
Copy link
Contributor Author

Let's keep what I've got and roll it forward. I'm willing to do the work and at least now we verify that the reporter gets created.

@dignifiedquire
Copy link
Member

Yeah that's fine with me. But I think we should split the commit messages into one for the feature one for new test as the test.

Make the JUnit adapter inherit from base
Push all log message into system-out element of the junit xml file.

Closes #302
E2E test framework was overriding the reporters on the commandline.
This meant that tests e2e tests for reporter were not even using the
reporters they were supposed testing.  The test now use the specified
reporters, even if they don't verify their outputs.
@bitwiseman
Copy link
Contributor Author

Done. Look good?

var xml;
var suites;
var pendingFileWritings = 0;
var fileWritingFinished = function() {};

this.adapters = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't remove this line. testacular run would fail.

I know, the way it's currently implemented is not nice, but until we refactor it, we need to keep this.
(when you do testacular run, it appends another adapter, to basically stream the output to the runner https://github.com/testacular/testacular/blob/master/lib/server.js#L164 and https://github.com/testacular/testacular/blob/master/lib/reporters/Multi.js#L9)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this is another example, that we just need better e2e tests, because weirdness like this is difficult to spot...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does my making this reporter inherit from BaseReporter change anything you just said about this line? If I kept this it would overwrite the adapter that was just added, wouldn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, you got me ;-) You are right!

@vojtajina
Copy link
Contributor

Thanks man! Just bring the one line back and I'm gonna merge it.

@vojtajina
Copy link
Contributor

Actually, would you mind sending the pull request to https://github.com/testacular/testacular-junit-reporter instead ?

The refactoring to support plugins should get merged soon and I already have all the stuff separated into plugins.

I already merged your second commit as 87f0ac0

Let me know if you need any help.

@vojtajina vojtajina closed this Feb 3, 2013
@bitwiseman
Copy link
Contributor Author

Okay, I'll apply this change to that repo.

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.

3 participants