Search code examples
jenkinscucumbercucumber-java

Jenkins not forgetting deleted cucumber test features


I have a Jenkins pipeline build that reports on cucumber tests using the "CucumberReportPublisher". When I delete tests or refactor a whole feature, many times the old tests hang around in the jenkins test report, showing as "skipped".

Is there a way to make Jenkins/CucmberReportPublisher forget about these old tests and stop reporting them as skipped?


Solution

  • It sounds like you don't have a clean environment when you build your project.

    I would make sure that Jenkins deleted the work space for the job and checked out the entire project from scratch for every build. I don't have a Jenkins to look at here, but there are different checkout options available for the job near the version control settings. Choose one that deletes the work space before checkout.

    Another option can be to clean as the first step in your build. Assuming that you use Maven, it could look like this

    mvn clean deploy
    

    This may solve your problem with ghost tests hanging around after deletion. But it may not solve your problem with a dirty work space.