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

Log details of why test discovery failed #5313

Closed
DonJayamanne opened this issue Apr 16, 2019 · 3 comments
Closed

Log details of why test discovery failed #5313

DonJayamanne opened this issue Apr 16, 2019 · 3 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release

Comments

@DonJayamanne
Copy link

Assume we have a test file with syntax errors, now attempt to discover tests.
The discovery process will fail with no indication of the cause.
Using the old approach we'd see the full error message.

We probably need to implement:

  • Logging of test discovery
  • And returning of discovered results

See here https://github.com/Microsoft/vscode-python/wiki/Testing-Architecture-Review#adapter-for-discovery-running--debugging

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug needs PR area-testing labels Apr 16, 2019
@ericsnowcurrently
Copy link
Member

This may mean printing out stdout and stderr in the same way we do in the functional tests.

Also, we might also consider leveraging pytest's exit codes.

@ericsnowcurrently ericsnowcurrently added the regression Bug didn't exist in a previous release label Apr 17, 2019
@DonJayamanne
Copy link
Author

DonJayamanne commented Apr 18, 2019

Also, we might also consider leveraging pytest's exit codes.

I disagree. why not make it simpler:
The adapter code returns the following info, all in one JSON:

  • Include stdout
  • Include stderr
  • Include the discovered tests

stderr in the same way we do in the functional tests.

Doing this breaks the JSON returned. The output from the discovery needs to be JSON. I don't think we should be looking for begin and end JSON markers.

Also, we shouldn't have to code for pytest exit codes, the whole point of using the adapter is so we don't have to worry about such things. What about unit test & nose or another in the future?

This way, if there are errors, we notify the user.
Either way, what ever is in stdout and stderr in the JSON returned we can dump it into the Python TestLog, as was done in the older version of the extension.

@karrtikr
Copy link

validated

@ghost ghost removed the needs PR label May 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug regression Bug didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

3 participants