Jenkins无法运行soapUI测试:没有要运行的测试

kyks70gy  于 2022-12-11  发布在  Jenkins
关注(0)|答案(1)|浏览(161)

我正在从Jenkins运行SoapUI测试我已将soapui-project.xml文件放在与pom.xml文件所在目录相同目录中,pom.xml文件位于bitbucket master中Jenkins可以选择pom.xml中所有更改,但无法运行测试Jenkins日志显示**“没有要运行测试”**
我尝试添加源代码,并将我的soapui-project.xml文件放在src/main/resources中,同时保留以下属性。

<sourceDirectory>src/main/resources</sourceDirectory>
<testSourceDirectory>src/main/resources</testSourceDirectory>

但行为没有改变。
我的pom.xml如下

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <name>Test soapui</name>
    <groupId>RestCountriesInfo</groupId>
    <artifactId>com.example.soapuitests</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <description>SOAPUITesting</description>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>
    
    <build>
           <!-- <sourceDirectory>src</sourceDirectory>
        <testSourceDirectory>src/main/resources</testSourceDirectory>
   -->
        <plugins>
            <plugin>
                <groupId>com.smartbear.soapui</groupId>
                <artifactId>soapui-maven-plugin</artifactId>
                <version>5.5.0</version>
 <dependencies>
                        <dependency>
                           <groupId>com.jgoodies</groupId>
                           <artifactId>forms</artifactId>
                           <version>1.2.1</version>
                        </dependency>
                    </dependencies>
                <executions>
                    <execution>
                        <id>RestCountriesInfo</id>
                        <configuration>
                            <projectFile>RestCountriesInfo-soapui-project.xml</projectFile>
                            <outputFolder>src/main/resources/report</outputFolder>
                            <testSuite>DEV</testSuite>
                            <junitReport>true</junitReport>
                            <exportAll>true</exportAll>
                            <printReport>true</printReport>
                            <testFailIgnore>true</testFailIgnore>
                        </configuration>
                        <goals>
                            <goal>test</goal>
                        </goals>
                       
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

这是Jenkins的日志

Posting build status of INPROGRESS to SWC Bitbucket for commit id [d95035dda15d279d5622478d8dbd178591e1f66a] and ref 'refs/heads/master'
Failed to post build status, additional information: timeout
[API_TEST] $ /opt/maven/bin/mvn clean test
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------< RestCountriesInfo:com.example.soapuitests >--------------
[INFO] Building Test soapui 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ com.example.soapuitests ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.example.soapuitests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ com.example.soapuitests ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ com.example.soapuitests ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /opt/jenkins/workspace/Feature/Dev/API_TEST/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ com.example.soapuitests ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ com.example.soapuitests ---
[INFO] No tests to run.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.454 s
[INFO] Finished at: 2022-11-29T12:47:34+11:00
[INFO] ------------------------------------------------------------------------

知道为什么Jenkins不能执行我的测试吗。

dgiusagp

dgiusagp1#

请注意,在日志输出中,soapui-maven-plugin从未运行过。
您有两个选项:
1.在Jenkins中,您可以指定目标阶段:com.smartbear.soapui:soapui-maven-plugin:5.5.0:test,根据官方文档。但是正如你所看到的,这包含了命令中的插件版本,这可能是不希望的。
1.您可以添加一个要在其中运行soapui插件的<phase>;可能是test。它会放在你的<configuration>块中。注意<goal><phase>不是一回事;它们各自配置了不同的东西,即使它们可能有相同的目标。2更多的信息可以在官方文档中找到。
顺便说一句,这个项目的<packaging>不是jar--没有编译阶段,它只是pom

相关问题