onsi / ginkgo

A Modern Testing Framework for Go
http://onsi.github.io/ginkgo/
MIT License
8.12k stars 644 forks source link

Using label-filter to execute non labeled tests #1312

Open ziccardi opened 8 months ago

ziccardi commented 8 months ago

Hello everyone!

Is there a way to specify a label-filter that executes all tests that has no label and all tests with a specific label?

I tried with // || mylabel but didn't work

Thank you in advance, Massimiliano

onsi commented 8 months ago

hey - good question. I haven't run into this before but you can make it work. label-filter accepts regular expressions. So you can target all specs with no labels via !/./ and then you can OR in the tests with a specific label via !/./ || LABEL

You might have to escape the ! on the terminal with \! but I just tried this locally and it worked. Give it a try!

ziccardi commented 8 months ago

Looks like !/./ does the trick!

Thank you very much!