Skip to content

chore(ci): add xunit output to evergreen config #2596

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

Merged
merged 4 commits into from
Nov 5, 2020
Merged

Conversation

emadum
Copy link
Contributor

@emadum emadum commented Oct 26, 2020

Description

  • Adds xunit reporting to the check: package scripts, via the spec-xunit-file reporter. This reporter is useful because it continues to send the output of the default spec reporter to stdout, while also generating an XML file with the xunit results.
  • Updated evergreen config to upload these results via attach.xunit_results in a post hook
  • This shows individual test results in Evergreen, example here - makes it a lot easier to see specific failing tests at a glance.

What changed?

Are there any files to ignore?

@emadum emadum marked this pull request as ready for review October 26, 2020 23:54
@emadum emadum changed the title test: add xunit output to evergreen config chore(ci): add xunit output to evergreen config Oct 27, 2020
Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

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

LGTM, mod a few questions/improvements

@@ -207,7 +207,6 @@ functions:
params:
working_dir: src
script: |
${PREPARE_SHELL}
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason this was removed?

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'm guessing it was a change that was made directly to the config.yml and not to config.yml.in, so it was lost when regenerating the file. I can take a closer look.

@@ -103,7 +103,7 @@ functions:
params:
file: mo-expansion.yml

bootstrap mongohoused:
"bootstrap mongohoused":
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to make this change without all the whitespace (quotation mark) changes in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I just added quotes to a few that were missing them for consistency - it makes the titles show up in a different color on syntax highlighting, which I thought was nice, but I can revert that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mbroadst Just confirming, should I revert the quotation mark changes I made to improve consistency?

Copy link
Member

Choose a reason for hiding this comment

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

No that's fine, I just wondered what was going on

@@ -1,3 +1,4 @@
{
"require": "ts-node/register"
"require": "ts-node/register",
"reporter": "spec-xunit-file"
Copy link
Member

Choose a reason for hiding this comment

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

hm this is specified in the script above, can we reduce it to one place?

Copy link
Contributor Author

@emadum emadum Nov 2, 2020

Choose a reason for hiding this comment

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

I didn't add --reporter spec-xunit-file to the npm scripts that use this file via the --config option in order to reduce verbosity. I can expand it out into the package scripts if desired.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you add this same setting to .mocharc.json?

Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

My logs filter PR #2605 undoes the work here in favor of an in house xml reporter.
There's a few features that this xml reporter lacks:

  • it doesn't capture stdout and stderr (meaning you can see deprecation warnings, for tests that care about that, or run special patches with print statements for debugging)
  • it escapes the text inside the CDATA blocks which is unnecessary, it makes reading the errors a bit strange
  • the timestamps aren't an ISO format
  • it emits one testsuite for all mocha tests, it doesn't change much about the display but its logically inconsistent with our test organization

I'm still LGTM-ing this though because all this isn't to say we shouldn't consider merging this, my PR is larger, and comes with more mental overhead, if we want this test reporting feature right now (which it is really nice to have) and end up accepting my PR later I still think that that could be worth our while.

@@ -1,3 +1,4 @@
{
"require": "ts-node/register"
"require": "ts-node/register",
"reporter": "spec-xunit-file"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you add this same setting to .mocharc.json?

@emadum emadum merged commit 1cfe7a6 into master Nov 5, 2020
@emadum emadum deleted the report-xunit branch November 5, 2020 15:12
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