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

Feature Request: Tag support #693

Closed
mmadson opened this issue May 20, 2024 · 5 comments
Closed

Feature Request: Tag support #693

mmadson opened this issue May 20, 2024 · 5 comments

Comments

@mmadson
Copy link

mmadson commented May 20, 2024

Hi again @AnWeber

Got another feature request idea and possibly another opportunity for me to contribute!

Thanks to the junit output support, our team is trying out httpyac for our basic functional web api tests on one of our projects.

One feature, however, that we miss from other testing frameworks -- such as junit -- is the ability to tag tests (or rather http requests in httpyac's case) and then specify the tags to run from the cli.

For example, say we have 2 http files:

# file1.http

 # @tag smoketest
GET https://httpbin.org/json
# file2.http

 # @tag smoketest
GET https://httpbin.org/json

 # @tag perftest
GET https://httpbin.org/json

Then say we want to run the 2 smoke tests in file1 and file2. It would be nice if we could call:

httpyac ./tests/* --includeTags smoketest -e dev --junit

And of course if we only want to run the single perf test in file2 we could call:

httpyac ./tests/* --includeTags perftest -e dev --junit

I think this tag info may also be useful in the junit xml reports, but that'd be a stretch goal IMO.

Let me know what you think. If you are open to the idea I can take a stab at the initial implementation.

AnWeber added a commit that referenced this issue May 20, 2024
@AnWeber
Copy link
Owner

AnWeber commented May 20, 2024

I'm not a fan of --includeTags and would use --tag instead, but otherwise I think the feature makes a lot of sense. I added it into httpyac CLI. I still have to figure out the necessary steps for the testrunner in vscode-httpyac

@mmadson
Copy link
Author

mmadson commented May 21, 2024

I'm not a fan of --includeTags and would use --tag instead, but otherwise I think the feature makes a lot of sense. I added it into httpyac CLI. I still have to figure out the necessary steps for the testrunner in vscode-httpyac

Incredible, thank you soo much!

@skirankumars31
Copy link

I totally miss this feature. Glad to learn that its already in the works

AnWeber added a commit to AnWeber/vscode-httpyac that referenced this issue Jun 1, 2024
@AnWeber
Copy link
Owner

AnWeber commented Jun 1, 2024

I have now released the tag feature. You can use # @tag foo, bar to set multiple tags per httpregion. In CLI it is possible to execute only certain tags with --tag=foo. In VSCode you can set a filter based on the tags. However, both require that I have to parse all files and therefore more CPU is needed.

@AnWeber AnWeber closed this as completed Jun 1, 2024
@mmadson
Copy link
Author

mmadson commented Jun 3, 2024

Thanks again @AnWeber , we'll be incorporating this into our test suite shortly.

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

No branches or pull requests

3 participants