Skip to content

Commit

Permalink
Add a perf-itest as a helper for performance scenarios (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasponce authored and jshaughn committed Oct 6, 2016
1 parent 3f063fa commit 767a9e2
Showing 1 changed file with 261 additions and 0 deletions.
261 changes: 261 additions & 0 deletions hawkular-alerts-rest-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,267 @@
</build>
</profile>

<profile>
<id>perf-itest</id>
<properties>
<hawkular.host>127.0.0.1</hawkular.host>
<hawkular.port>8080</hawkular.port>
<hawkular.port.offset>0</hawkular.port.offset>
<hawkular.path>/hawkular/alerts/</hawkular.path>
<hawkular.base-uri>http://${hawkular.host}:${hawkular.port}${hawkular.path}</hawkular.base-uri>
<hawkular.management.port>9990</hawkular.management.port>
<hawkular.log.alerts>INFO</hawkular.log.alerts>
</properties>
<dependencies>
<dependency>
<groupId>org.hawkular.commons</groupId>
<artifactId>hawkular-nest-feature-pack</artifactId>
<version>${version.org.hawkular.commons}</version>
<type>pom</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hawkular.commons</groupId>
<artifactId>hawkular-nest-feature-pack</artifactId>
<version>${version.org.hawkular.commons}</version>
<type>zip</type>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hawkular.commons</groupId>
<artifactId>hawkular-commons-embedded-cassandra-war</artifactId>
<version>${version.org.hawkular.commons}</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Build a wildfly + bus + accounts distro from feature packs -->
<plugin>
<groupId>org.wildfly.build</groupId>
<artifactId>wildfly-server-provisioning-maven-plugin</artifactId>
<executions>
<execution>
<id>server-provisioning</id>
<goals>
<goal>build</goal>
</goals>
<phase>compile</phase>
<configuration>
<config-file>server-provisioning.xml</config-file>
</configuration>
</execution>
</executions>
</plugin>

<!-- Install hawkular-alerts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install-hawkular-alerts</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.hawkular.alerts</groupId>
<artifactId>hawkular-alerts-rest-standalone</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${project.build.finalName}/modules/system/layers/hawkular/org/hawkular/nest/main/deployments</outputDirectory>
<destFileName>hawkular-alerts.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.hawkular.alerts</groupId>
<artifactId>hawkular-alerts-actions-email-standalone</artifactId>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${project.build.finalName}/modules/system/layers/hawkular/org/hawkular/nest/main/deployments</outputDirectory>
<destFileName>hawkular-alerts-actions-email.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.hawkular.alerts</groupId>
<artifactId>hawkular-alerts-actions-file-standalone</artifactId>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${project.build.finalName}/modules/system/layers/hawkular/org/hawkular/nest/main/deployments</outputDirectory>
<destFileName>hawkular-alerts-actions-file.war</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.hawkular.commons</groupId>
<artifactId>hawkular-commons-embedded-cassandra-war</artifactId>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/${project.build.finalName}/modules/system/layers/hawkular/org/hawkular/nest/main/deployments</outputDirectory>
<destFileName>hawkular-commons-embedded-cassandra-war.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<!-- Install hawkular-alerts demo data for itests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-users-data</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/standalone/configuration</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${project.basedir}/src/test/resources</directory>
<includes>
<include>application-roles.properties</include>
<include>application-users.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

<!-- Configure hawkular-alerts -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<executions>
<execution>
<id>transform-standalone-xml</id>
<phase>pre-integration-test</phase>
<goals>
<goal>transform</goal>
</goals>
<configuration>
<transformationSets>
<!-- standalone.xml -->
<transformationSet>
<dir>${project.build.directory}/${project.build.finalName}/standalone/configuration</dir>
<stylesheet>src/test/resources/standalone-hawkular.xsl</stylesheet>
<includes>
<include>standalone.xml</include>
</includes>
<outputDir>${project.build.directory}/${project.build.finalName}/standalone/configuration</outputDir>
</transformationSet>
</transformationSets>
</configuration>
</execution>
</executions>
</plugin>

<!-- Start wildfly -->
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<jboss-home>${project.build.directory}/${project.build.finalName}</jboss-home>
<skip>${skipTests}</skip>
<startupTimeout>240</startupTimeout>
<port>${hawkular.management.port}</port>
<javaOpts>
<javaOpt>-server</javaOpt>
<javaOpt>-Xms64m</javaOpt>
<javaOpt>-Xmx512m</javaOpt>
<javaOpt>-Djava.net.preferIPv4Stack=true</javaOpt>
<javaOpt>-Djboss.modules.system.pkgs=org.jboss.byteman</javaOpt>
<javaOpt>-Djava.awt.headless=true</javaOpt>
<javaOpt>-Djboss.bind.address=${hawkular.host}</javaOpt>
<javaOpt>-Djboss.socket.binding.port-offset=${hawkular.port.offset}</javaOpt>
<javaOpt>-Dkeycloak.import=${project.build.directory}/${project.build.finalName}/standalone/configuration/hawkular-realm-for-dev.json</javaOpt>
<javaOpt>-Dmail.smtp.host=localhost</javaOpt>
<javaOpt>-Dmail.smtp.port=2525</javaOpt>
<javaOpt>-Dhawkular.backend=embedded_cassandra</javaOpt>
<javaOpt>-Dhawkular.log.alerts=${hawkular.log.alerts}</javaOpt>
<!--<javaOpt>-Xdebug</javaOpt>-->
<!--<javaOpt>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</javaOpt>-->
</javaOpts>
</configuration>
<executions>
<execution>
<id>start-wildfly</id>
<phase>pre-integration-test</phase>
<configuration>
<server-config>standalone.xml</server-config>
</configuration>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-wildfly</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Configure integration tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<hawkular.host>${hawkular.host}</hawkular.host>
<hawkular.port>${hawkular.port}</hawkular.port>
<hawkular.base-uri>${hawkular.base-uri}</hawkular.base-uri>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>exec-rest-tests</id>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<includes>
<include>org/hawkular/alerts/rest/PerfCrudITest.class</include>
</includes>
<excludes>
<excludeFile>org/hawkular/alerts/rest/ClusterITest.class</excludeFile>
<excludeFile>org/hawkular/alerts/rest/IntegrationSuite.class</excludeFile>
<exclude>${hawkular.itest-exclude}</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>final-verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</profile>

<!-- This profile prepares a standalone distribution of hawkular-alerts on top of a Wildfly Server -->
<profile>
<id>build-standalone</id>
Expand Down

0 comments on commit 767a9e2

Please sign in to comment.