bazel - JUnit4Runner inside bazel could be use with junit `Category`?

71 Views Asked by At

Bazel has their JUnit4Runner in com.google.testing.junit package which seems to be based on junit4.

I tried to use Bazel JUnit4Runner with Categroy Annotation. But not worked for me.

And 1 seems to support testIncludeFilterRegexp but not junit's Categroy.

So does JUnit4Runner from Bazel not support Category? I am not sure. any help would be appreciated.

1

There are 1 best solutions below

0
On

When structuring TestSuite with Category, I had to use @RunWith(Categories::class)

Following code worked for me.

@RunWith(Categories::class)
@Suite.SuiteClasses(AllTests::class)
@Categories.IncludeCategory(EnormousTest::class)
class AllEnormousTests

@RunWith(ClasspathSuite::class)
class AllTests