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

fix(teamcity_reporter): nest tests by prefix #1262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

makepanic
Copy link
Contributor

fixes #1187

@stefanpenner
Copy link
Contributor

@Turbo87 this appears related to: Turbo87/intellij-emberjs#166 mind confirming this is good?

@makepanic
Copy link
Contributor Author

To confirm that the reporter changes still work, I've loaded it up in ember-intellij with the patched test run configuration:

20180604-210601

@stefanpenner
Copy link
Contributor

@makepanic awesome. That looks great. Once I get @Turbo87's +1, i'll merge and ship. :)

assert.match(output, /##teamcity\[testFailed name='phantomjs - it handles undefined errors' message='' details='']/);
assert.match(output, /##teamcity\[testFinished name='phantomjs - it handles undefined errors' duration='42']/);
assert.match(output, /##teamcity\[testSuiteStarted name='phantomjs']/);
assert.match(output, /##teamcity\[testSuiteFinished name='phantomjs']/);
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that this is currently not testing the order in which these messages are reported, but I guess that might be a good idea to make sure that testSuiteFinished is only printed after all the tests have finished 🤔

Copy link
Contributor Author

@makepanic makepanic Jun 5, 2018

Choose a reason for hiding this comment

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

I think what you're asking about is tested in the next test.
The change to this test was only made to get the test to succeed.

if (this.prefixedResults.hasOwnProperty(prefix)) {
this.out.write('##teamcity[testSuiteStarted name=\''+prefix+'\']\n');
this.prefixedResults[prefix].forEach(this._display.bind(this));
this.out.write('##teamcity[testSuiteFinished name=\''+prefix+'\']\n');
Copy link
Contributor

Choose a reason for hiding this comment

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

is it intended that this._duration() was dropped from the testSuiteFinished event?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think previously it was an error as the jetbrains docs mention duration only for Test start/stop messages

@Turbo87
Copy link
Contributor

Turbo87 commented Jun 5, 2018

@makepanic if I understand this patch correctly then previously it would write out test results as they are reported. with this change it would only write out the results at the end of the whole test suite. does that have any negative implications for tools that want to report the test results "live"?

@makepanic
Copy link
Contributor Author

with this change it would only write out the results at the end of the whole test suite. does that have any negative implications for tools that want to report the test results "live"?

Right that could be an issue.
With this PR the behavior changes from writing the result when it arrives to buffering until the tests are finished, similar to the xunit reporter.

@stefanpenner
Copy link
Contributor

stefanpenner commented Jun 5, 2018

With this PR the behavior changes from writing the result when it arrives to buffering until the tests are finished, similar to the xunit reporter.

That seems a tad unfortunate for those with long/large test suites. Maybe this should be opt-in?

@makepanic
Copy link
Contributor Author

I guess one could add a new reporter parallel to the old teamcity reporter.

Dunno if it's a good idea to ship it in testem or as an extra package.

@Turbo87
Copy link
Contributor

Turbo87 commented Jun 7, 2018

@makepanic can you check if IntelliJ merges test suites with the same name? then we could open a new test suite per test, and let IntelliJ worry about merging them up so that tests are grouped per suite 🤔

@makepanic
Copy link
Contributor Author

check if IntelliJ merges test suites with the same name

Great idea.
I've tested it but sadly they generate tons of nested suites containing only one test.
I've also tried to use flowId and emitting suiteStarted/Finished with the defined test name format but that also didn't work :<

I guess the teamcity format requires input to be xml'ish.

Dunno if the additional overhead of maintaining a new test reporter, additional configuration or introducing a breaking change is worth it tbh.

@Turbo87
Copy link
Contributor

Turbo87 commented Jun 11, 2018

hmm okay. guess then there is not much we can do about this unfortunately. I'm fine either way, the implementation looks good to me.

@makepanic I guess it's up to you. If you think this is the right way forward than I'm 👍on merging this.

@makepanic
Copy link
Contributor Author

makepanic commented Jun 11, 2018

I think it's better not to break clients as the change is only cosmetic.

As we can't really do it in a backwards compatible way, I'm ok with closing the PR + the issue.

@stefanpenner
Copy link
Contributor

@makepanic in theory, we could make this opt-in? (if there is concern about backwards compat)

@makepanic
Copy link
Contributor Author

in theory, we could make this opt-in?

yes that should be possible

@stefanpenner
Copy link
Contributor

@makepanic with opt-in, i see not reason not to merge + release immediately once complete. Just be sure to add the appropriate docs :)

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.

Possibly nest teamcity suites by launcher (prefix)
3 participants