0

I run ui-automated tests (java+maven+junit4) on TeamCity. And there are some tests which are ignored for some reasons. So I'm trying to pass these reasons to teamcity results. How it looks on teamcity

Tests are ignored via using Assume.assumeFalse - e.g.

Assume.assumeFalse("some message which I'd like to see on teamcity", false);

And then in the end there is special block for skipped tests

protected void skipped(AssumptionViolatedException e, Description description) {

        logger.info("##teamcity[testMetadata name='Reason' value='" + e.getMessage() +"']");
    }

Earlier I've tried use just logger.info with simple text, but it seems nothing is written to the log for skipped tests. So I've tried the code above - pass message as metadata - it's feature available in the latest version of teamcity(More info there), but it still didn't help.

Maybe anyone has some ideas how can I implement that? Or is it even possible?

1 Answers1

0

If you would really like to ignore some tests then you should go for @Ignore Junit annotation. Reason could also be passed to this annotation as a parameter.

This annotation can be used to ignore test methods and whole test classes.

Here are some benefits to use this annotation.

To check, how to use this annotation, please refer following links:

http://junit.sourceforge.net/javadoc/org/junit/Ignore.html

https://www.mkyong.com/unittest/junit-4-tutorial-3-ignore-test/

Anshul Singhal
  • 1,983
  • 20
  • 25