Skip to content

Log details of why test discovery failed #5313

Closed

Description

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

Activity

  1. ericsnowcurrently commented on Apr 17, 2019

    @ericsnowcurrently

    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.

  2. DonJayamanne commented on Apr 18, 2019

    @DonJayamanne
    Author

    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.

  3. karrtikr commented on May 21, 2019

    @karrtikr

    validated

  4. locked as resolved and limited conversation to collaborators on Jun 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bugregressionBug didn't exist in a previous release

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions