The project works in conjunction webdriver + testng + jenkins + allure2. The problem is, if you run the mvn clean test locally, and then allure serve target / allure-results, the report is generated normally. But jenkins pulls old suite. My pom

<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <aspectj.version>1.8.10</aspectj.version> <allure.version>2.0-BETA18</allure.version> <selenium.version>3.5.3</selenium.version> <maven.compiler.version>3.7.0</maven.compiler.version> </properties> <dependencies> <dependency> <groupId>io.qameta.allure</groupId> <artifactId>allure-testng</artifactId> <version>${allure.version}</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>${selenium.version}</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.11</version> </dependency> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>mssql-jdbc</artifactId> <version>6.2.1.jre8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.25</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven.compiler.version}</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>${project.build.sourceEncoding}</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.20</version> <configuration> <suiteXmlFiles> <suiteXmlFile>testng-suite.xml</suiteXmlFile> </suiteXmlFiles> <argLine> -Djava.library.path=${basedir}/lib -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" </argLine> <systemProperties> <property> <name>allure.results.directory</name> <value>${project.build.directory}/allure-results</value> </property> </systemProperties> </configuration> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> </dependency> </dependencies> </plugin> </plugins> </build> <reporting> <excludeDefaults>true</excludeDefaults> <plugins> <plugin> <groupId>io.qameta.allure</groupId> <artifactId>allure-maven</artifactId> <version>2.8</version> <configuration> <reportVersion>2.3.1</reportVersion> <resultsDirectory>${project.build.directory}/allure-results</resultsDirectory> </configuration> </plugin> </plugins> </reporting> 

This is my jenkins

  • In Jenkins, workspace cleared before each build? At least not all, but only non-versioned files (test results fall into this category). Or you can manually run git clean -fdx before git clean -fdx . (Be careful, the command deletes all unversioned files, both ignored and not). - Nick Volynkin
  • It seems to me that git simply does not add reports, after running the tests. Do not tell me, maybe somewhere in jenkinse - there are settings in the git so that it adds, or I bear some kind of nonsense) - user257666
  • git is a version control system, it does not chase tests or add reports. But they can clean the files remaining from the old test run. - Nick Volynkin
  • Oh, and mvn clean should do the same thing. Check if mvn clean is done on jenkins. Read the assembly logs. - Nick Volynkin
  • Alyur 2nd is able to work with the history of test launches (integration with Jenkins out of the box), are you sure that this is not the history of previous launches? If so, then smoke a manual alyur, there results of launches can be done. But this is definitely not a Jenkins problem and even more testng - Olegus Testerovichus

0