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

Adopt new Test APIs #1162

Closed
jdneo opened this issue Mar 22, 2021 · 4 comments
Closed

Adopt new Test APIs #1162

jdneo opened this issue Mar 22, 2021 · 4 comments

Comments

@jdneo
Copy link
Member

jdneo commented Mar 22, 2021

VS Code team is working on a new set of testing APIs. We plan to migrate to that API to provide better and more unified experience for testing scenarios.

@TimWebb
Copy link

TimWebb commented Aug 4, 2021

@jdneo Is there any chance of leveraging the TestMessage.location field to include where the message should be bound in the source for assert failures and exceptions? It would appear from usage you already have this data from other visualizations the plugin does.

The other place location is set in findTestLocation also seems to set the general location of the test, whereas, I read the TestMessage.location field to be specific location inside the test method. Certainly I may be wrong on the interpretation of intended usage! All that said, awesome to have these APIs stabilizing!

For context, working on an integration that leverages test results on the new Testing API.

@jdneo
Copy link
Member Author

jdneo commented Aug 5, 2021

@TimWebb Do you mean set the location to the exact line where the case is failed (instead of appearing at the method definition)?

@TimWebb
Copy link

TimWebb commented Aug 5, 2021

@jdneo Yes, that was my intent.

More specifically, if an assert fails, have the TestMessage's location of the assert match the location in the method for the given assert. Similarly if something triggers an exception, we could have a TestMessage for the exception in potentially even a different file - such as extract from the exception stack the location in testMethod() that resulted in the failure.

@jdneo
Copy link
Member Author

jdneo commented Aug 6, 2021

More specifically, if an assert fails, have the TestMessage's location of the assert match the location in the method for the given assert.

Currently we will put a diff view at the location of assertion failure (in most cases, since it's parsed via regexp)

image

But I agree put the stacktrace to where it happens is a good idea.

Similarly if something triggers an exception, we could have a TestMessage for the exception in potentially even a different file - such as extract from the exception stack the location in testMethod() that resulted in the failure.

Not quite sure about this. My concern is how user can know which case generates this message if they located in different files.

BTW I created an issue for this: #1266. You can add some comments there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants