bruno icon indicating copy to clipboard operation
bruno copied to clipboard

[Feature Request] Flag a request to be exclude from test runner

Open stgonzales opened this issue 1 year ago • 4 comments

It would be good to have a way to mark each request to be exclude from the test runner. This could be by adding a meta flag or in a blacklist format.

stgonzales avatar Nov 23 '23 14:11 stgonzales

Yes, we will support this.

I am thinking of supporting a more generic feature called tags Here is how I am envisioning it

  • A tag is essential a string. Ex: regression, sanity
  • Each request can have multiple tags
  • When running the collection, we should be able to run tests where only requests with a certain set of tags get included

Here is how it would look in the bru file.

meta {
  name: Get Users
  type: http
  seq: 1,
  tags: [
    sanity,
    regression
  ]
}

The GUI Collection runner will support options to only run requests which match a certain set of tags.

In the CLI, we can have something like

bru run --tags=sanity,regression

Let me know if you have feedback or suggestions

cc @dcoomber @jeff-edmondson-pci @rabestro @mj-h @Its-treason @martinsefcik

helloanoop avatar Jan 12 '24 10:01 helloanoop

@helloanoop The concept of tags is handy, and it is supported by many testing frameworks. I suggest considering the option not only to run tests that contain a specific tag but also to exclude tests with a particular tag. For example, in the Karate framework, there is no special annotation, but you can add a tag named "ignore" and then run tests while excluding the ones with the "ignore" tag.

rabestro avatar Jan 16 '24 09:01 rabestro

@helloanoop The concept of tags is handy, and it is supported by many testing frameworks. I suggest considering the option not only to run tests that contain a specific tag but also to exclude tests with a particular tag. For example, in the Karate framework, there is no special annotation, but you can add a tag named "ignore" and then run tests while excluding the ones with the "ignore" tag.

Maybe something like this then?

bru run --tags=sanity,regression --exclude-tags=ignore

That way it's not specific to a hard-coded tag name like ignore, and the collection that is run is the aggregate of all tests that match at least one of the tags in the --tags argument, minus any tests that match at least one of the tags in the --exclude-tags list.

KirkMunroSagent avatar Apr 09 '24 20:04 KirkMunroSagent

@helloanoop do we have any estimate when this feature will be available as we integrate our collection with CICD and would like to exclude few POST request for PRODUCTION environment to avoid adding data.

Is there a workaround which I can explore via script to move to next/skip request in the runner.?

brvaland avatar May 22 '24 04:05 brvaland

@helloanoop your suggested solution is perfect. Any idea when are you going to deliver it?

irharrier2 avatar Jul 09 '24 10:07 irharrier2

Seems to be related to or possibly even implemented (different solution than suggested) with #2397

nikischin avatar Sep 02 '24 17:09 nikischin