joshelser commented on a change in pull request #1052: HBASE-23695 Fail gracefully if no category is present URL: https://github.com/apache/hbase/pull/1052#discussion_r367639392
########## File path: hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java ########## @@ -41,9 +41,12 @@ @Override public void testStarted(Description description) throws Exception { Category[] categories = description.getTestClass().getAnnotationsByType(Category.class); - for (Class<?> c : categories[0].value()) { - if (c == IntegrationTests.class) { - return; + // Don't fail if there is a missing category + if (categories.length > 0) { + for (Class<?> c : categories[0].value()) { Review comment: The `@Category` annotation is not `Repeatable` so we can only have a single one. Its value is `Class<?>[]`, so we can't provide anything else, e.g. an array of class<?>[] is disallowed. I think this is OK, but will add an explicit check on this :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services