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

feat(buildcop): add support for Python #237

Merged
merged 7 commits into from
Jan 29, 2020
Merged

feat(buildcop): add support for Python #237

merged 7 commits into from
Jan 29, 2020

Conversation

tbpg
Copy link
Contributor

@tbpg tbpg commented Jan 24, 2020

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.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 24, 2020
Copy link
Contributor

@bcoe bcoe left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@tbpg
Copy link
Contributor Author

tbpg commented Jan 28, 2020

Enabling for all of them (where desired) is the goal!

@tbpg tbpg merged commit 2722ecc into master Jan 29, 2020
@tbpg tbpg deleted the buildcop branch January 29, 2020 12:59
@tbpg tbpg mentioned this pull request Jan 29, 2020
3 tasks
yoshi-automation added a commit that referenced this pull request Apr 1, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants