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

Clean up XUnitParser and add tests. #7263

Merged

Conversation

ericsnowcurrently
Copy link
Member

This is a precursor to the fix for (for #6990).

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • [ ] Has a news entry file (remember to thank yourself!)
  • Appropriate comments and documentation strings in the code
  • [ ] Has sufficient logging.
  • [ ] Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated
  • [ ] Test plan is updated as appropriate
  • [ ] package-lock.json has been regenerated by running npm install (if dependencies have changed)
  • [ ] The wiki is updated with any design decisions/details.

@ericsnowcurrently ericsnowcurrently added the no-changelog No news entry required label Sep 6, 2019
@codecov-io
Copy link

codecov-io commented Sep 6, 2019

Codecov Report

Merging #7263 into master will increase coverage by 0.87%.
The diff coverage is 71.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7263      +/-   ##
==========================================
+ Coverage   57.82%   58.69%   +0.87%     
==========================================
  Files         494      494              
  Lines       21475    21825     +350     
  Branches     3494     3498       +4     
==========================================
+ Hits        12417    12811     +394     
+ Misses       8267     8217      -50     
- Partials      791      797       +6
Impacted Files Coverage Δ
src/client/testing/types.ts 95% <100%> (+0.88%) ⬆️
src/client/testing/explorer/failedTestHandler.ts 95.83% <100%> (+0.18%) ⬆️
...ient/testing/common/services/testResultsService.ts 88% <100%> (+0.24%) ⬆️
...rc/client/testing/explorer/testTreeViewProvider.ts 66.21% <100%> (ø) ⬆️
src/client/testing/common/types.ts 100% <100%> (ø) ⬆️
...nt/testing/common/services/discoveredTestParser.ts 16.1% <22.22%> (ø) ⬆️
src/client/testing/nosetest/runner.ts 18.86% <50%> (ø) ⬆️
src/client/testing/pytest/runner.ts 18% <50%> (ø) ⬆️
src/client/testing/common/xUnitParser.ts 66.1% <62.26%> (+58.52%) ⬆️
src/client/testing/explorer/commandHandlers.ts 77.27% <66.66%> (-0.51%) ⬇️
... and 37 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4aa1f0...2d46d6a. Read the comment docs.

Copy link

@kimadeline kimadeline left a comment

Choose a reason for hiding this comment

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

Can you rename helpers-declarative, helpers-nodes and helpers-results using camelCase? I'm also not sold on the idea of splitting the helpers in 4 different files 🤔 The unit test imports

import { createResults } from '../helpers-declarative';
import { TestItem } from '../helpers-nodes';
import { createEmptyResults } from '../helpers-results';

so why not have all these methods (and the rest of the the helper methods) in the same spot?

src/client/testing/common/xUnitParser.ts Outdated Show resolved Hide resolved
src/client/testing/common/xUnitParser.ts Outdated Show resolved Hide resolved
src/client/testing/common/xUnitParser.ts Outdated Show resolved Hide resolved
src/test/testing/common/xUnitParser.unit.test.ts Outdated Show resolved Hide resolved
src/test/testing/helpers-declarative.ts Outdated Show resolved Hide resolved
src/test/testing/helpers-declarative.ts Outdated Show resolved Hide resolved
@ericsnowcurrently
Copy link
Member Author

As to the multiple "helpers-" files, there are several reasons:

  • there is a natural division between the different modules
  • as a single file it would be much longer than I like to make files (<300 lines)
  • the structure is a nudge toward changes we should make in src/client/testing/common/types.ts
  • I almost made a "helpers" subpackage but chickened out :)

Copy link

@kimadeline kimadeline left a comment

Choose a reason for hiding this comment

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

Once you update how you structure your helpers-* files we good to go 👍

src/client/testing/common/xUnitParser.ts Outdated Show resolved Hide resolved
@ericsnowcurrently ericsnowcurrently merged commit 9f69bf7 into microsoft:master Sep 19, 2019
@ericsnowcurrently ericsnowcurrently deleted the clean-up-XUnitParser branch September 19, 2019 21:15
@lock lock bot locked as resolved and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-changelog No news entry required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants