如果将值设置为TESTS,则Maven不会并行运行测试

qxsslcnc  于 2022-10-05  发布在  Maven
关注(0)|答案(1)|浏览(127)

我有API测试,它与maven和TestNG一起运行。但是在并行运行时,当它被设置为测试时,它不会运行,并且我有多个@测试。

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M5</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>src/test/java/suite.xml</suiteXmlFile>
          </suiteXmlFiles>
          <systemProperties>
            <property>
              <name>env</name>
            </property>
          </systemProperties>
          <properties>
            <property>
              <name>parallel</name>
              <value>tests</value>
            </property>
            <property>
              <name>dataproviderthreadcount</name>
              <value>10</value>
            </property>
            <property>
              <name>threadCount</name>
              <value>10</value>
            </property>
          </properties>
        </configuration>
      </plugin>
ztigrdn8

ztigrdn81#

用TestNG套件的话来说,parallel=tests不会转换为@测试方法。您需要设置parallel=methods以使所有带@Test注解的方法并行运行。

相关问题