-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat(buildcop): add support for Python #237
Conversation
Python has a slightly different flavor of xUnit output. So, I updated the parsing to match (testsuites and package name handling). I switched the XML parsing to be compact. It makes iterating over the results a bit cleaner to not have to worry about 'elements'. There is no loss of accuracy for this purpose. The not-compact version only seems needed if you need stable parsing and re-printing. The Python test results also come in many different log files. So, I changed the logic for checking when a test passed to be an explicit pass rather than just not-fail. A possible downside of this is that if a failing test is renamed, the corresponding issue will not be automatically closed/renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, can we consider enabling it for some of our API repos not just the samples repo? CC: @busunkim96?
const obj = xmljs.xml2js(xml, { compact: true }) as xmljs.ElementCompact; | ||
const failures: TestCase[] = []; | ||
const passes: TestCase[] = []; | ||
// Python doesn't always have a top-level testsuites element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be curious to see if we bump into similar edge-cases with Node.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too. I imagine we will for all of the languages, which is why I included comments/tests for both languages.
Enabling for all of them (where desired) is the goal! |
2722ecc commit 2722ecc Author: Tyler Bui-Palsulich <26876514+tbpg@users.noreply.github.com> Date: Wed Jan 29 07:58:50 2020 -0500 feat(buildcop): add support for Python (#237) Python has a slightly different flavor of xUnit output. So, I updated the parsing to match (testsuites and package name handling). I switched the XML parsing to be compact. It makes iterating over the results a bit cleaner to not have to worry about 'elements'. There is no loss of accuracy for this purpose. The not-compact version only seems needed if you need stable parsing and re-printing. The Python test results also come in many different log files. So, I changed the logic for checking when a test passed to be an explicit pass rather than just not-fail. A possible downside of this is that if a failing test is renamed, the corresponding issue will not be automatically closed/renamed.
Python has a slightly different flavor of xUnit output. So, I updated
the parsing to match (testsuites and package name handling).
I switched the XML parsing to be compact. It makes iterating over the
results a bit cleaner to not have to worry about 'elements'. There is no
loss of accuracy for this purpose. The not-compact version only seems
needed if you need stable parsing and re-printing.
The Python test results also come in many different log files. So, I
changed the logic for checking when a test passed to be an explicit pass
rather than just not-fail. A possible downside of this is that if a
failing test is renamed, the corresponding issue will not be
automatically closed/renamed.