Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'nokogiri'
- filename = 'pom.xml'
- scenario_name = ENV['scenario_name']
- scenario_name2 = ENV['scenario_full_name']
- builder = Nokogiri::XML::Builder.new do
- 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") do
- parent_ do
- groupId 'us.cipherhealth.jmeter'
- artifactId 'evolve-performance'
- version '0.1.0-SNAPSHOT'
- relativePath '../../pom.xml'
- end
- modelVersion '4.0.0'
- groupId 'us.cipherhealth.jmeter'
- artifactId scenario_name
- version '0.1.0-SNAPSHOT'
- packaging 'jar'
- name scenario_name2
- description ''
- build {
- plugins {
- plugin {
- groupId 'com.lazerycode.jmeter'
- artifactId 'jmeter-maven-plugin'
- version '1.9.0'
- configuration {
- testResultsTimestamp 'false'
- overrideRootLogLevel 'DEBUG'
- suppressJMeterOutput 'false'
- ignoreResultFailures 'true'
- propertiesUser {
- webservice.host '${performancetest.webservice.host}'
- webservice.port '${performancetest.webservice.port}'
- webservice.path '${performancetest.webservice.path}'
- webservice.connectTimeout '${performancetest.connectTimeout}'
- webservice.responseTimeout '${performancetest.responseTimeout}'
- threadCount '${performancetest.threadCount}'
- loopCount '${performancetest.threadCount}'
- }
- propertiesJMeter {
- jmeter.save.saveservice.thread_counts 'true'
- }
- jmeterPlugins {
- plugin {
- groupId 'kg.apc'
- artifactId 'jmeter-plugins'
- }
- }
- }
- executions {
- execution {
- id 'execute-jmeter-tests'
- goals {
- goal 'jmeter'
- }
- phase 'integration-test'
- }
- }
- dependencies {
- dependency {
- groupId 'kg.apc'
- artifactId 'jmeter-plugins'
- version '1.0.0'
- exclusions {
- exclusion {
- groupId 'kg.apc'
- artifactId 'perfmon'
- }
- exclusion {
- groupId 'org.apache.hadoop'
- artifactId 'hadoop-core'
- }
- exclusion {
- groupId 'org.apache.hbase'
- artifactId 'hbase'
- }
- exclusion {
- groupId 'org.apache.jmeter'
- artifactId 'jorphan'
- }
- exclusion {
- groupId 'org.apache.bsf'
- artifactId 'bsf-api'
- }
- exclusion {
- groupId 'org.bouncycastle'
- artifactId 'bcmail-jdk15'
- }
- exclusion {
- groupId 'org.bouncycastle'
- artifactId 'bcprov-jdk15'
- }
- exclusion {
- groupId 'javax.activation'
- artifactId 'activation'
- }
- exclusion {
- groupId 'commons-logging'
- artifactId 'commons-logging'
- }
- }
- }
- }
- }
- plugin {
- groupId 'com.lazerycode.jmeter'
- artifactId 'jmeter-analysis-maven-plugin'
- version '1.0.4'
- configuration {
- source "${project.build.directory}/jmeter/results/#{scenario_name}.jtl"
- }
- executions {
- execution {
- id 'create-html-report'
- goals {
- goal 'analyze'
- }
- phase 'verify'
- }
- }
- }
- plugin {
- groupId 'org.mortbay.jetty'
- artifactId 'jetty-maven-plugin'
- version '8.1.14.v20131031'
- configuration {
- connectors {
- connector 'implementation' => "org.eclipse.jetty.server.nio.SelectChannelConnector"
- port '${jetty.port}'
- }
- stopPort '${jetty.stopPort}'
- stopKey 'STOP'
- }
- }
- plugin {
- groupId 'de.codecentric'
- artifactId 'jmeter-graph-maven-plugin'
- version '0.1.0'
- executions {
- execution {
- id 'create-graph-threads'
- goals {
- goal 'create-graph'
- }
- phase 'verify'
- }
- }
- configuration {
- inputFile "${project.build.directory}/jmeter/results/#{scenario_name}"
- graphs {
- graph {
- pluginType 'ThreadsStateOverTime'
- width '800'
- height '600'
- outputFile "${project.build.directory}/jmeter/results/#{scenario_name}-ThreadsStateOverTime.png"
- }
- graph {
- pluginType 'ResponseTimesOverTime'
- width '800'
- height '600'
- outputFile "${project.build.directory}/jmeter/results/#{scenario_name}-ResponseTimesOverTime.png"
- }
- graph {
- pluginType 'TransactionsPerSecond'
- width '800'
- height '600'
- outputFile "${project.build.directory}/jmeter/results/#{scenario_name}-TransactionsPerSecond.png"
- }
- }
- }
- }
- }
- }
- end
- end
- #puts builder.to_xml
- File.write("scenarios/#{scenario_name}/#{filename}", builder.to_xml)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement