t.me/atinfo_chat Telegram группа по автоматизации тестирования

Не запускаются тесты в Jenkins если в pom.xml есть раздел includes

jenkins
selenide
java
selenium
maven
Теги: #<Tag:0x00007fb2f828d720> #<Tag:0x00007fb2f828d5e0> #<Tag:0x00007fb2f828d428> #<Tag:0x00007fb2f828d220> #<Tag:0x00007fb2f828d0b8>

(Pavel) #1

Всем привет! Разбираюсь с CI на Jenkins. У меня проект собирается на maven и после сборки запускаются тесты. Так вот, если я добавляю в файл pom.xml блок и указываю, какие-то тесты, то jenkins просто не запускает тесты, при этом сборка проходит успешно

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>ru.minicom.itphone.web</groupId>
    <artifactId>ru.minicom.itphone.web</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <!--selenium versions-->
        <selenium-java.version>3.141.59</selenium-java.version>
        <webdriver-factory.version>4.3</webdriver-factory.version>
        <selenide.version>5.4.1</selenide.version>
        <!--JUnit versions-->
        <junit-jupiter-api.version>5.5.2</junit-jupiter-api.version>
        <junit-jupiter-engine.version>5.5.2</junit-jupiter-engine.version>
        <junit-jupiter-params.version>5.5.2</junit-jupiter-params.version>
        <junit5-engine.version>5.0.0-ALPHA</junit5-engine.version>
        <!--Allure versions-->
        <allure-junit5.version>2.13.0</allure-junit5.version>
        <allure-junit-platform.version>2.13.0</allure-junit-platform.version>
        <!--Extra instruments versions-->
        <jsch.version>0.1.55</jsch.version>
        <commons-io.version>2.6</commons-io.version>
        <!--Maven plugin versions-->
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <junit-platform-surefire-provider.version>1.3.2</junit-platform-surefire-provider.version>
        <aspectj.version>1.9.4</aspectj.version>
        <allure-maven.version>2.10.0</allure-maven.version>
    </properties>

    <dependencies>
        <!--Dependencies selenium and frameworks for selenium-->
        <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium-java.version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/ru.stqa.selenium/webdriver-factory -->
        <dependency>
            <groupId>ru.stqa.selenium</groupId>
            <artifactId>webdriver-factory</artifactId>
            <version>${webdriver-factory.version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.codeborne/selenide -->
        <dependency>
            <groupId>com.codeborne</groupId>
            <artifactId>selenide</artifactId>
            <version>${selenide.version}</version>
        </dependency>
        <!--Dependencies frameworks for testings-->
        <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-jupiter-api.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-jupiter-engine.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit-jupiter-params.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.junit/junit5-engine -->
        <dependency>
            <groupId>org.junit</groupId>
            <artifactId>junit5-engine</artifactId>
            <version>${junit5-engine.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.github.artsok</groupId>
            <artifactId>rerunner-jupiter</artifactId>
            <version>LATEST</version>
        </dependency>
        <!--Dependencies for reporting-->
        <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-junit5 -->
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-junit5</artifactId>
            <version>${allure-junit5.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-junit-platform -->
        <dependency>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-junit-platform</artifactId>
            <version>${allure-junit-platform.version}</version>
        </dependency>
        <!--Dependencies extra instruments-->
        <!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>${jsch.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--Plugin for building maven project-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!--Plugin for unit testings-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <testFailureIgnore>false</testFailureIgnore>
                    <argLine>
                        -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    </argLine>
                    <systemProperties>
                        <property>
                            <name>junit.jupiter.extensions.autodetection.enabled</name>
                            <value>true</value>
                        </property>
                        <property>
                            <name>allure.results.directory</name>
                            <value>${project.build.directory}/allure-results</value>
                        </property>
                    </systemProperties>
                    <includes>
                        <include>**\TestsServices\Test3SettingsSipServer.java</include>
                        <include>**\TestsServices\Test4Providers.java</include>
                    </includes>
                    <excludes>
                        <exclude>**\TestsLoginOnServer\Test1LoginAdmin.java</exclude>
                        <exclude>**\TestsLoginOnServer\Test2LoginOper.java</exclude>
                    </excludes>
                </configuration>
                <dependencies>
                    <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                    <!-- https://mvnrepository.com/artifact/org.junit.platform/junit-platform-surefire-provider -->
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>${junit-platform-surefire-provider.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- https://mvnrepository.com/artifact/ru.yandex.qatools.allure/allure-maven-plugin -->
            <plugin>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>${allure-maven.version}</version>
                <configuration>
                    <reportVersion>2.6.0</reportVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

На моём ПК тесты запускаются в такой конфигурации. Может кто сталкивался с подобной проблемой?


(Михаил Братухин) #2

Свой ПК на Windows? А инстанс дженкинса на Linux’е?


(Pavel) #3

Да все верно. Из-за этого?


(Михаил Братухин) #4

Из-за того как include написали, да. У вас win-стиль


(Pavel) #5

А понял ошибку, косые в другую сторону нужно. Спасибо большое. Завтра попробую.