You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2022/01/18 13:40:14 UTC

[directory-fortress-core] branch master updated: move the maven jmeter plugin back into a profile

This is an automated email from the ASF dual-hosted git repository.

smckinney pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-fortress-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 3aa7744  move the maven jmeter plugin back into a profile
3aa7744 is described below

commit 3aa7744ba16a854b7898d560e11a1347a132f768
Author: Shawn McKinney <sm...@symas.com>
AuthorDate: Tue Jan 18 07:40:09 2022 -0600

    move the maven jmeter plugin back into a profile
---
 README-LOAD-TESTING.md |  33 ++++++-------
 pom.xml                | 122 ++++++++++++++++++++++++++-----------------------
 2 files changed, 82 insertions(+), 73 deletions(-)

diff --git a/README-LOAD-TESTING.md b/README-LOAD-TESTING.md
index 89a2294..997ec75 100644
--- a/README-LOAD-TESTING.md
+++ b/README-LOAD-TESTING.md
@@ -82,7 +82,7 @@ ________________________________________________________________________________
  Will add user entry.  Optionally will perform an update and/or role assignment.
  
   ```
-  mvn verify -Dtype=ftAddUser -Dqualifier=A1 -Dverify=true -Dsleep=30 -Dupdate=true -Dou=loadtestu -Drole=jmeterrole
+  mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Dverify=true -Dsleep=30 -Dupdate=true -Dou=loadtestu -Drole=jmeterrole
   ```
 
   This test adds users.  It uses runtime arguments to define behavior:
@@ -99,7 +99,7 @@ ________________________________________________________________________________
  B. Delete Users:
  
   ```
-  mvn verify -Dtype=ftDelUser -Dqualifier=A1 -Dverify=true -Dsleep=30
+  mvn verify -Ploadtest -Dtype=ftDelUser -Dqualifier=A1 -Dverify=true -Dsleep=30
   ```
 
   * Same properties as add except for 'ou', which is not used for delete ops
@@ -109,7 +109,7 @@ ________________________________________________________________________________
  Will perform a createSession.  Optionally reads the entry and/or permission checks.
  
   ```
-  mvn verify -Dtype=ftCheckUser -Dqualifier=A1 -Dverify=true -Dsize=20 -Dperm=jmeterobject.oper
+  mvn verify -Ploadtest -Dtype=ftCheckUser -Dqualifier=A1 -Dverify=true -Dsize=20 -Dperm=jmeterobject.oper
   ```
 
   This test performs createSession on users.  It uses runtime arguments to define behavior:
@@ -123,7 +123,7 @@ A. Qualifier property.
 The add test generates userids based on: hostname + qualifier + counter.  The counter is global across all threads, so if you enable 20 threads * 100 loops, with a qualifier = 'A1', 2,000 users will be added:
 
   ```
-  mvn verify -Dtype=ftAddUser -Dqualifier=A1
+  mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1
   ```
 
 hostname-A1-1
@@ -135,13 +135,13 @@ hostname-A1-1000
 If you run the test a second time (before a delete run) there will be duplicates because it tries to add users with same userids again.  This is the idea of the 'qualifier'.  Change its value to ensure the uids remain unique across test runs.
 
   ```
-  mvn verify -Dtype=ftAddUser -Dqualifier=A2
+  mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A2
   ```
 
 Or, you can run a delete before the next add:
 
   ```
-  mvn verify -Dtype=ftDelUser -Dqualifier=A1
+  mvn verify -Ploadtest -Dtype=ftDelUser -Dqualifier=A1
   ```
 
 Just make sure the thread and loop counts in ftDelUser.jmx are the same as ftAddUser.jmx
@@ -151,7 +151,7 @@ B. Verify
 If set to true, after every operation, a read of the entry will be performed.
 
   ```
-  mvn verify -Dtype=ftAddUser -Dqualifier=A1 -Dverify=true
+  mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Dverify=true
   ```
 
 C. Update
@@ -159,7 +159,7 @@ C. Update
 If set to true, after every add, an update will be performed on user's description field.
 
   ```
-  mvn verify -Dtype=ftAddUser -Dqualifier=A1 -Dupdate=true
+  mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Dupdate=true
   ```
 
 D. Role
@@ -167,7 +167,7 @@ D. Role
 If 'role' set as property, it will be assigned after the user has been added.  The role itself must already exist before being used in assignment to user.
 
   ```
-  mvn verify -Dtype=ftAddUser -Dqualifier=A1 -Drole=jmeterrole
+  mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Drole=jmeterrole
   ```
 
 E. Perm
@@ -175,7 +175,7 @@ E. Perm
 This applies only to the CheckUser test.  If set, it will be used as permission in checkAccess call 10 times.  For example:
 
   ```
-  mvn verify -Dtype=ftCheckUser -Dperm=jmeterobject.oper
+  mvn verify -Ploadtest -Dtype=ftCheckUser -Dperm=jmeterobject.oper
   ```
 
   Will call checkAccess:
@@ -192,16 +192,17 @@ These assignments must already exist before running this test.
 
 A. View the results
 
-* target/jmeter/results/[DATE]-ftAddUser.jtl
-* target/jmeter/results/[DATE]ftDelUser.jmx.jtl
-* target/jmeter/results/[DATE]ftCheckUser.jtl
+* target/[guid]/jmeter/results/[DATE]-ftAddUser.jtl
+* target/[guid]/jmeter/results/[DATE]ftDelUser.jmx.jtl
+* target/[guid]/jmeter/results/[DATE]ftCheckUser.jtl
 
 B. View the logs
 
-* target/jmeter/logs/ftAddUser.jmx.log
-* target/jmeter/logs/ftDelUser.jmx.log
-* target/jmeter/logs/ftCheckUser.jmx.log
+* target/[guid]/jmeter/logs/ftAddUser.jmx.log
+* target/[guid]/jmeter/logs/ftDelUser.jmx.log
+* target/[guid]/jmeter/logs/ftCheckUser.jmx.log
 
+* Where [guid] == a generated tag, e.g. '66dce123-75d1-49ac-80fd-c33147872daa'
 ____________________________________________________________________________________
  
  #### END OF README
diff --git a/pom.xml b/pom.xml
index e4cebcf..b9d528b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -574,6 +574,7 @@
               <suppressionFile>${project.basedir}/src/owasp/suppression.xml</suppressionFile>
           </configuration>
         </plugin>
+
       </plugins>
     </pluginManagement>
 
@@ -705,63 +706,6 @@
 
         </executions>
       </plugin>
-
-      <!-- To execute: mvn verify jmeter:jmeter -Dtype=testname [-Dmore=args] -->
-      <plugin>
-        <groupId>com.lazerycode.jmeter</groupId>
-        <artifactId>jmeter-maven-plugin</artifactId>
-        <version>${version.jmeter.plugin}</version>
-        <configuration>
-          <testPlanLibraries>
-            <artifact>org.apache.directory.fortress:fortress-core:${project.version}</artifact>
-            <artifact>org.apache.directory.fortress:fortress-core:jar:tests:${project.version}</artifact>
-            <artifact>org.apache.commons:commons-pool2:${commons-pool2.version}</artifact>
-          </testPlanLibraries>
-          <suppressJMeterOutput>false</suppressJMeterOutput>
-          <testFilesIncluded>
-            <jMeterTestFile>${type}.jmx</jMeterTestFile>
-          </testFilesIncluded>
-          <propertiesSystem>
-            <version>${project.version}</version>
-            <tenant>${tenant}</tenant>
-            <hostname>${hostname}</hostname>
-            <qualifier>${qualifier}</qualifier>
-            <verify>${verify}</verify>
-            <output>${output}</output>
-            <sleep>${sleep}</sleep>
-            <size>${size}</size>
-            <perm>${perm}</perm>
-            <ou>${ou}</ou>
-          </propertiesSystem>
-          <jMeterProcessJVMSettings>
-            <xms>1024</xms>
-            <xmx>1024</xmx>
-          </jMeterProcessJVMSettings>
-        </configuration>
-        <executions>
-          <execution>
-            <id>configuration</id>
-            <phase>pre-integration-test</phase>
-            <goals>
-              <goal>configure</goal>
-            </goals>
-          </execution>
-          <!-- Run JMeter tests -->
-          <execution>
-            <id>jmeter-tests</id>
-            <goals>
-              <goal>jmeter</goal>
-            </goals>
-          </execution>
-          <!-- Fail build on errors in test -->
-          <execution>
-            <id>jmeter-check-results</id>
-            <goals>
-              <goal>results</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
 
     <testResources>
@@ -862,6 +806,70 @@
       </build>
     </profile>
 
+    <!-- To execute: mvn verify -Ploadtest -Dtype=testname [-Dmore=args] -->
+    <profile>
+      <id>loadtest</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>com.lazerycode.jmeter</groupId>
+            <artifactId>jmeter-maven-plugin</artifactId>
+            <version>${version.jmeter.plugin}</version>
+            <configuration>
+              <testPlanLibraries>
+                <artifact>org.apache.directory.fortress:fortress-core:${project.version}</artifact>
+                <artifact>org.apache.directory.fortress:fortress-core:jar:tests:${project.version}</artifact>
+                <artifact>org.apache.commons:commons-pool2:${commons-pool2.version}</artifact>
+              </testPlanLibraries>
+              <suppressJMeterOutput>false</suppressJMeterOutput>
+              <testFilesIncluded>
+                <jMeterTestFile>${type}.jmx</jMeterTestFile>
+              </testFilesIncluded>
+              <propertiesSystem>
+                <version>${project.version}</version>
+                <tenant>${tenant}</tenant>
+                <hostname>${hostname}</hostname>
+                <qualifier>${qualifier}</qualifier>
+                <verify>${verify}</verify>
+                <output>${output}</output>
+                <sleep>${sleep}</sleep>
+                <size>${size}</size>
+                <perm>${perm}</perm>
+                <ou>${ou}</ou>
+              </propertiesSystem>
+              <jMeterProcessJVMSettings>
+                <xms>1024</xms>
+                <xmx>1024</xmx>
+              </jMeterProcessJVMSettings>
+            </configuration>
+            <executions>
+              <execution>
+                <id>configuration</id>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>configure</goal>
+                </goals>
+              </execution>
+              <!-- Run JMeter tests -->
+              <execution>
+                <id>jmeter-tests</id>
+                <goals>
+                  <goal>jmeter</goal>
+                </goals>
+              </execution>
+              <!-- Fail build on errors in test -->
+              <execution>
+                <id>jmeter-check-results</id>
+                <goals>
+                  <goal>results</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
     <!-- This profile calls ant target init-slapd in build-config.xml script. -->
     <!-- To execute: mvn -Pinit-slapd test -->
     <profile>