Как запустить несколько тестов jmeter .jmx с несколькими входными файлами, используя jmeter.maven.plugin - PullRequest
0 голосов
/ 03 октября 2019

Мне нужно иметь возможность запускать тесты jmeter от jenkins с помощью mvn и jmeter-maven-plugin.

Вот настройки файла:

test_dev.jmx
test_dev.txt
test_dev_regression.jmx
test_dev_regression.txt

Здесь используется файл pomс помощью команды mvn (ниже):

<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>com.example</groupId>
    <artifactId>JmeterTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>JMeter Example </name>
    <properties>
        <input.jmx.folder>${project.basedir}/src/test/jmeter</input.jmx.folder>
        <input.jmx.file>test_${Environment}.jmx</input.jmx.file>
        <input.csv>${project.basedir}/src/test/jmeter/test_${Environment}.txt</input.csv>
    </properties>

    <build>
        <sourceDirectory>src</sourceDirectory>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>2.9.0</version>
                <configuration>
                    <propertiesUser>
                        <threadgroup00.dataFile>${input.csv}</threadgroup00.dataFile>
                    </propertiesUser>
                    <testFilesIncluded>
                        <!-- If spcified, only particular file will be processed. -->
                        <jMeterTestFile>${input.jmx.file}</jMeterTestFile> 
                    </testFilesIncluded>
                    <testResultsTimestamp>false</testResultsTimestamp>
                    <!-- This will pick up all the jmx file at below folder. -->
                    <testFilesDirectory>${input.jmx.folder}</testFilesDirectory>
                    <generateReports>true</generateReports>
                    <resultsFileFormat>csv</resultsFileFormat>
                </configuration>

                <executions>
                    <execution>
                        <id>jmeter-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>jmeter</goal>
                            <goal>results</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>

А вот команда, которую мы используем для запуска тестов:

mvn verify -DEnvironment=$TEST_ENVIRONMENT

Как видите, в настоящее время нет регрессионных тестовбыть запущенным. Я хотел бы добавить регрессионный тест и его входной файл в этот pom, чтобы оба теста запускались один за другим. Зависание для меня - это собственность <threadgroup00.dataFile>. Что нужно указать здесь, чтобы использовать другой входной файл для регрессионного теста? Или есть другой способ запустить несколько тестов с несколькими входами, используя эту платформу?

Заранее спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...