Update parser for pytest to handle changes in pytest >= 3.7 (while still supporting pytest < 3.7)#2465
Merged
Merged
Conversation
brettcannon
approved these changes
Aug 30, 2018
| const trimmedLine: string = line.trim(); | ||
|
|
||
| if (trimmedLine.startsWith('<Package \'')) { | ||
| // process the previous lines |
Member
There was a problem hiding this comment.
"Process the previous lines."
| private parsePyTestModuleCollectionResult(rootDirectory: string, lines: string[], testFiles: TestFile[], parentNodes: { indent: number; item: TestFile | TestSuite }[]) { | ||
|
|
||
| /** | ||
| * Extract the 'package' name from a given PyTest (>= 3.7) output line |
| runner.verifyAll(); | ||
| testParser.verifyAll(); | ||
| }); | ||
| // build tests for the test data that is relevant for this platform. |
| }); | ||
| // build tests for the test data that is relevant for this platform. | ||
| pytestScenarioData.forEach((testScenario) => { | ||
| const testPlatformType: PytestDataPlatformType = |
Member
There was a problem hiding this comment.
Does this need to be re-calculated for each test scenario?
|
|
||
| // tslint:disable-next-line:no-invalid-this | ||
| if (testPlatformType === testScenario.platform) { | ||
| const testDescription: string = 'PyTest '.concat('[', testScenario.pytest_version_spec, '] ', testScenario.description); |
Member
There was a problem hiding this comment.
Any reason not to use string interpolation?
3e7d698 to
8a6e6b7
Compare
Fix microsoft#2347 - Add the 'Package' information to the Parser - Correct how we discover mixed package/non-package tests - Add unit tests for < 3.7.0 parsing - Add unit tests for >= 3.7.0 parsing
- add json test data for running through various scenarios (WIP)
- Better for coping with many scenarios - Update tests to pull scenario data from json file - Linux/macOS scenarios are covered - TODO: Windows
- Discovery and parsing are related but belong in separate files
8a6e6b7 to
7dbf4db
Compare
- remove some unnecessary operations from for loop. - correct string construction to use interpolation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2347
Add the 'Package' information to the Parser
Correct how we discover mixed package/non-package tests
Add unit tests for < 3.7.0 parsing
Add unit tests for >= 3.7.0 parsing
Title summarizes what is changing
Has a news entry file (remember to thank yourself!)
Has unit tests & system/integration tests
Any new/changed dependencies inpackage.jsonare pinned (e.g."1.2.3", not"^1.2.3"for the specified version)package-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed)WIP - Additional tasks to complete