usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject git commit: adding conditional checks for scenarios
Date Tue, 04 Nov 2014 16:58:57 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/key-row-sharding 74e365a40 -> c37b2240a


adding conditional checks for scenarios


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/c37b2240
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/c37b2240
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/c37b2240

Branch: refs/heads/key-row-sharding
Commit: c37b2240ada7d6cf428310c807d85b4d2c681f36
Parents: 74e365a
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Nov 4 09:58:42 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Nov 4 09:58:42 2014 -0700

----------------------------------------------------------------------
 .../apache/usergrid/scenarios/ApplicationScenarios.scala  |  2 +-
 .../apache/usergrid/scenarios/NotificationScenarios.scala |  5 +++++
 .../org/apache/usergrid/scenarios/NotifierScenarios.scala |  6 ++++++
 .../apache/usergrid/scenarios/OrganizationScenarios.scala | 10 +++++-----
 .../PushNotificationTargetUserSimulation.scala            |  2 +-
 5 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c37b2240/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ApplicationScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ApplicationScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ApplicationScenarios.scala
index 7d11a49..8faf8c7 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ApplicationScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/ApplicationScenarios.scala
@@ -45,7 +45,7 @@ object ApplicationScenarios {
 
    val checkApplication = exec(http("Get Application")
      .get(Settings.baseAppUrl)
-     .headers(Headers.jsonAnonymous)
+     .headers(Headers.jsonAuthorized)
      .check(status.saveAs("applicationStatus"))
    )
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c37b2240/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
index 23bfcef..19f875d 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotificationScenarios.scala
@@ -72,6 +72,11 @@ object NotificationScenarios {
   val userFeeder = FeederGenerator.generateUserWithGeolocationFeeder(Settings.numUsers *
 Settings.duration, Settings.userLocationRadius, Settings.centerLatitude, Settings.centerLongitude)
 
   val createScenario = scenario("Create Push Notification")
+    .asLongAs(session=>session.get("applicationStatus")!="200" && session.get("notifierStatus")!="200"){
+      exec(TokenScenarios.getManagementToken)
+        .exec(ApplicationScenarios.checkApplication)
+        .exec(NotifierScenarios.checkNotifier)
+    }
     .feed(userFeeder)
     .exec( UserScenarios.postUser)
     .exec(TokenScenarios.getUserToken)

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c37b2240/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotifierScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotifierScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotifierScenarios.scala
index 4349d92..55c3d52 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotifierScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/NotifierScenarios.scala
@@ -60,5 +60,11 @@ object NotifierScenarios {
     .body(StringBody("{\"name\":\"" + notifier + "\",\"provider\":\"" + provider + "\"}"))
     .check(status.in(200 to 400)))
 
+  val checkNotifier = exec(http("Get Notifier")
+    .get(Settings.baseAppUrl+"/notifiers/"+notifier)
+    .headers(Headers.jsonAuthorized)
+    .check(status.is(200),status.saveAs("notifierStatus"))
+  )
+
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c37b2240/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
index 43b40ad..873759b 100755
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/OrganizationScenarios.scala
@@ -46,13 +46,13 @@ object OrganizationScenarios {
     feed(FeederGenerator.generateRandomEntityNameFeeder("org", 1))
       .exec(createOrgAndAdmin)
       .exec(TokenScenarios.getManagementToken)
-      .exec(session => {
-        // print the Session for debugging, don't do that on real Simulations
-        println(session)
-        session
-      })
       .exec(ApplicationScenarios.createApplication)
       .exec(NotifierScenarios.createNotifier)
+      .exec(session => {
+      // print the Session for debugging, don't do that on real Simulations
+      println(session)
+      session
+    })
 
   val createOrgScenario = scenario("Create org").exec(createOrgBatch)
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c37b2240/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
----------------------------------------------------------------------
diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
index b8d57d1..67447e0 100644
--- a/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
+++ b/stack/loadtests/src/main/scala/org/apache/usergrid/simulations/PushNotificationTargetUserSimulation.scala
@@ -24,7 +24,7 @@ import scala.concurrent.duration._
 
 class PushNotificationTargetUserSimulation extends Simulation {
   val scnToRun = NotificationScenarios.createScenario
-    .inject(nothingFor(15),constantUsersPerSec(Settings.numUsers) during (Settings.duration))
// wait for 15 seconds so create org can finish, need to figure out coordination
+    .inject(constantUsersPerSec(Settings.numUsers) during (Settings.duration)) // wait for
15 seconds so create org can finish, need to figure out coordination
     .throttle(reachRps(Settings.throttle) in ( Settings.rampTime.seconds))
     .protocols( Settings.httpConf.acceptHeader("application/json"))
 


Mime
View raw message