AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
237 stars 20 forks source link

Httpyac tests in Vscode Test Explorer #140

Closed BramManuel closed 2 years ago

BramManuel commented 2 years ago

I have been using vscode-httpyac for a while now, and I love it! But there is one thing I miss, and that's running my tests, the CLI supports running test and also the httpbook supports it.

I would like to use the native VS Code test explorer to run all of my httpyac tests.

PR is on its way 😉

li1234yun commented 2 years ago

Hello! It's good idea! This is my some advices:

image image

This is go test explore result. All test results under one entry(go mod name).

AnWeber commented 2 years ago

@li1234yun

If the test icon is always show will be better when I write new http request.

Yes I would have planned for the test icon to appear immediately when changes are made to a file. The necessary event registrations are still missing in the current state. I have broken the implementation of BramManual. I would have also built in the special case that when executing a test it behaves like when you press the CodeLens (directly show response in separate editor)

Test explore may have other language result, such as go/python. Maybe http tests can be in a directory.

Do you mean that the root folder should be something like httpyac Test Provider? I would have used the folder structure of the workspace directly. Similar to Jest Extension. Go Extension or Java Test Runner uses a language specific representation (packages, modules). Do you have a good idea, how to create a useful folder structure? The idea that I use information from .http files, I have discarded, because in large projects the performance suffers.

li1234yun commented 2 years ago

Hello @AnWeber

Do you mean that the root folder should be something like httpyac Test Provider?

Yes, becasue same workspace maybe exists multiple tests result, such as Go/Python etc. It will be better in one folder.

Do you have a good idea, how to create a useful folder structure?

image image

Python use the project file layout.

image image

Go use package module name and test file name.

AnWeber, you can refer them. I think I would have used the folder structure of the workspace directly. is fine.

BramManuel commented 2 years ago

@AnWeber Do you have an idea when this will be released? Thanks for all the refactoring, I learned allot from it 👍

AnWeber commented 2 years ago

@BramManuel Sorry that it takes longer. I stumbled across https://github.com/microsoft/vscode/issues/156925 and still had thought about using FileSystemWatcher and added more and more features. I will publish it the next days. I try today. Just one more small feature:-)

AnWeber commented 2 years ago

I have published the test controller support. Please test once and more suggestions. And thanks again for the PR @BramManuel