0

I have cucumber tests with rest-Assured. I tried to use @Skip tags to exclude some tests. But Jenkins integration test stage in the pipeline shows as unstable(Amber).

enter image description here

Code that enables skip

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
    plugin = {"pretty", "html:target/reports/cucumber-html-report",
        "html:target/cucumber-reports/cucumber-pretty",
        "json:target/cucumber.json"},
    tags = {"not @skip"},
    glue = {"myproject.stepdefinitions"},
    features = "src/it/resources/features/")

public class MyCucumberTests {
}

Serenity reports correctly shows that particular test as skipped

enter image description here

How to make the test Jenkins pipeline stage green as no tests failed.

Shabar
  • 2,617
  • 11
  • 57
  • 98
  • are you sure the reason for the pipeline being amber is because of that skip tag. Check pipeline log and roll out the possibility of no additional failure – Mrunal Gosar Nov 09 '20 at 05:43
  • @MrunalGosar Yes, once commented out the `skip ` test pipeline was green. – Shabar Nov 09 '20 at 08:01
  • 1
    Do one thing can you run your tests via maven on command line and check maven build status. It should be successful. If it isn't then the issue is with not pipeline but with your maven build. – Mrunal Gosar Nov 10 '20 at 04:30
  • @MrunalGosar Good point. Tried that and looks like skip doesn't really work. Build success but log shows that skipped test failure. Not sure why it tries to run the skip test? – Shabar Nov 10 '20 at 06:03
  • :) And that's the reason why we don't use serenity. Personal opinion there's absolutely nothing that you can't achieve with plain cucumber (including rich reporting options) – Mrunal Gosar Nov 10 '20 at 14:20
  • I figured out the issue, which is the case error, I have used `@Skip` instead of `@skip` – Shabar Nov 11 '20 at 00:12
  • @MrunalGosar BTW what's your recommendation if not serenity. – Shabar Nov 11 '20 at 00:14
  • I suspected that earlier but in your code I can see you have used correct lower case 'skip'. Did you override tags from command line?. Also with regards to serenity alternatives, The question is what is it that serenity gives you which cucumber is not able to? – Mrunal Gosar Nov 12 '20 at 07:51
  • @MrunalGosar In my feature file I have set the tag with incorrect case,. When you say cucumber what report you referring to? is it `target/reports/cucumber-html-report/index.html`? If so, that report is just lengthy one. But in contrast, serenity gives your chart by default and drill down options which is quit clean in my view – Shabar Nov 13 '20 at 01:00
  • there's extent-report, there's clue-report from trivago, there's maven-cucumber-html report..in short if you are using serenity just for reporting then it's an overkill..psst: there's allure-report too :) – Mrunal Gosar Nov 13 '20 at 05:20

0 Answers0