Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果Gatling在maven构建期间断言失败,它将不会进入“集成后测试”阶段,这将使spring启动运行_Maven_Spring Boot_Performance Testing_Gatling - Fatal编程技术网

如果Gatling在maven构建期间断言失败,它将不会进入“集成后测试”阶段,这将使spring启动运行

如果Gatling在maven构建期间断言失败,它将不会进入“集成后测试”阶段,这将使spring启动运行,maven,spring-boot,performance-testing,gatling,Maven,Spring Boot,Performance Testing,Gatling,我正在使用failsafe插件进行集成测试,它在测试失败时运行良好。执行集成后测试阶段,该阶段调用spring boot:stop。使用相同的模式,我想对Gatling进行性能测试。看起来好像是gatlingmaven插件没有相同的功能,并且集成测试阶段的故障不能保证调用集成后测试。因此,spring boot应用程序仍在运行,后续运行将无法启动 我在互联网上搜寻了几个小时,寻找解决方案,但他们都只是半途而废。它们显示了如何执行gatling测试,但没有显示如何在故障期间恢复 gatling插件

我正在使用failsafe插件进行集成测试,它在测试失败时运行良好。执行
集成后测试
阶段,该阶段调用
spring boot:stop
。使用相同的模式,我想对Gatling进行性能测试。看起来好像是
gatlingmaven插件
没有相同的功能,并且
集成测试
阶段的故障不能保证调用
集成后测试
。因此,spring boot应用程序仍在运行,后续运行将无法启动

我在互联网上搜寻了几个小时,寻找解决方案,但他们都只是半途而废。它们显示了如何执行gatling测试,但没有显示如何在故障期间恢复


gatling插件是否具有此功能?如果没有,我如何在maven构建失败后直接调用
集成后测试
阶段?

一个足够的解决方法是将
spring boot maven插件
配置为不分叉。在生成失败(由于gatling断言失败)和生成成功期间,我的应用程序按预期停止

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${spring.boot.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>repackage</goal>
                </goals>
              </execution>
              <execution>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
        </plugin>
    </plugins>
</build>

org.springframework.boot
springbootmaven插件
${spring.boot.version}
重新包装
预集成测试
开始
整合后测试
停止


演出
真的
真的
org.springframework.boot
springbootmaven插件
假的
加特林
gatlingmaven插件
${gatling plugin.version}
执行

一个足够的解决方法是将
spring boot maven插件配置为不分叉。在生成失败(由于gatling断言失败)和生成成功期间,我的应用程序按预期停止

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${spring.boot.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>repackage</goal>
                </goals>
              </execution>
              <execution>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
        </plugin>
    </plugins>
</build>

org.springframework.boot
springbootmaven插件
${spring.boot.version}
重新包装
预集成测试
开始
整合后测试
停止


演出
真的
真的
org.springframework.boot
springbootmaven插件
假的
加特林
gatlingmaven插件
${gatling plugin.version}
执行